feat: add markdown output for exposure scoring - #8
Open
mattpartida wants to merge 2 commits into
Open
mattpartida wants to merge 2 commits into
mattpartida wants to merge 2 commits into
Conversation
Add --format json|markdown to score_prompt_injection_exposure.py, bringing it to parity with config_risk_summary.py and flag_prompt_injection_signals.py. JSON remains the default so existing consumers are unaffected. The markdown renderer emits a score/severity header, a risk factors table with per-factor points, a total points line, and the heuristic note. Empty/clean configs and error inputs render a consistent header without a factors table.
…e-score-markdown # Conflicts: # CHANGELOG.md
Owner
Author
|
Resolved merge conflict against latest main (both CHANGELOG entries kept: exposure-score markdown + reproducible packages). Merge commit |
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
score_prompt_injection_exposure.pywas the only one of the three main scanner scripts without Markdown output.config_risk_summary.py(Phase 1) andflag_prompt_injection_signals.py(#6) already support--format json|markdown. This PR closes that parity gap by adding--format json|markdownto the exposure scorer, keeping JSON as the default so all existing consumers continue to work unchanged.Why this is safe / additive
--formatis omitted.Files changed
skills/agent-security/scripts/score_prompt_injection_exposure.py— addedrender_markdown(),markdown_cell(), and--format json|markdown(defaultjson).tests/test_score_prompt_injection_exposure.py— 6 new tests covering header/score, factors table, total + note, empty-input error rendering, clean-config no-factors branch, and JSON-as-default.README.md— added a--format markdownexample next to the existing exposure-scoring quick start.skills/agent-security/SKILL.md— added a markdown example to the script usage block.CHANGELOG.md— unreleased script CLI entry.Test Plan
Local verification (Python 3.11, matching CI):
python -m compileall -q skills tests— OKruff check .— All checks passedpython -m pytest -q— 95 passed (89 prior + 6 new)./package-skills.sh— packaged both skillsgit diff --check— clean