Skip to content

feat(output): add opt-in risk assessment - #70

Merged
limaronaldo merged 1 commit into
mainfrom
agent/risk-score-output
Jul 24, 2026
Merged

feat(output): add opt-in risk assessment#70
limaronaldo merged 1 commit into
mainfrom
agent/risk-score-output

Conversation

@limaronaldo

Copy link
Copy Markdown
Collaborator

Summary

  • add scan --experimental-risk for console and JSON
  • compute one agentshield-risk-v1 assessment from the final post-policy/post-baseline findings
  • keep PASS/FAIL primary and label the index informational
  • expose model and coverage identities plus bounded, source-safe contributions
  • reject SARIF, HTML and --explain combinations explicitly

Compatibility and policy

Default console, JSON, SARIF, HTML and DSSE output is unchanged. The flag does not change findings, policy thresholds, verdicts, exit status, fingerprints, baselines or suppressions. The public addition is one renderer function returning a string; internal assessment types remain private.

Safety

At most 50 ordered contributions are emitted, with an explicit omitted count. Contributions contain only fingerprint, rule id, effective severity, confidence and points. No source, snippets, evidence or environment data is copied.

Review

Code review found no blockers. Two evidence gaps were fixed before publication: a real 50-contribution truncation test and a console ordering/label test.

Validation

  • cargo fmt --all --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --workspace --all-targets --locked — 419 passed
  • cargo test --no-default-features --locked — 385 passed
  • supported python, typescript, runtime and runtime-guard feature checks
  • real console and JSON smoke runs
  • git diff --check

@limaronaldo limaronaldo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review verdict: PASS — no unresolved findings.

Checklist:

  • opt-in only; default render path is unchanged
  • score consumes final report findings after policy and optional CLI baseline filtering
  • verdict and process exit status remain authoritative
  • console keeps PASS/FAIL before the informational section
  • JSON adds data only under explicit opt-in
  • SARIF, HTML, explain and DSSE are not modified
  • assessment is computed once per render
  • model and coverage identities accompany the score
  • contributions are deterministic, source-safe and capped at 50
  • unsupported combinations fail as invocation errors
  • public API change is additive and internal types stay private
  • default/no-default and supported feature configurations pass

@limaronaldo
limaronaldo marked this pull request as ready for review July 24, 2026 15:01
@limaronaldo
limaronaldo merged commit cf818c6 into main Jul 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant