cloudsec: evidence chain, coverage, code impact and remediation commands - #395
Merged
Merged
Conversation
Adds finding chain, code coverage, code impact and a remediation group (list, get, create, approve, reject, cancel) with matching SDK methods. Reasons and actions are printed as the server sent them; an assertive outcome is never shown on a stage that is not proven; a coverage percentage is shown only for a complete, fresh, untruncated count. Approve, reject and cancel print a review first and send nothing without a confirmation token bound to the run's generation and target digest. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lcbill
approved these changes
Sep 23, 2026
Contributor
Author
|
Self-review of a pristine Checked, and sound:
Known limits, recorded rather than fixed here:
|
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.
Adds CLI and SDK access to four Code Security read and decision routes: a finding's evidence chain, Code Security coverage, code impact, and remediation runs.
Commands
cloudsec finding chain <id> [--runtime] [--summary]shows the eight-stage evidence chain for a finding (declared, committed, built, running, exposed, observed, responded, verified). Reasons and next actions are printed exactly as the server sent them, so a token this version does not know stays visible.--summarynever displays an assertive outcome (verified,exposed,not_observed...) on a stage that is not proven.cloudsec code coverage [--summary]shows coverage with explicit numerators and denominators. An unmeasured metric has no numbers.--summaryshows a percentage only for a complete, fresh, untruncated count with a positive denominator. Otherwise it shows the counts, the reason and the next action.cloudsec code impact --repo-urn <urn> [--commit <sha>] | --finding-id <id>shows which live resources a repository's infrastructure code touches.cloudsec remediation list|get|create|approve|reject|cancelmanages remediation runs.--confirm, a decision sends nothing. It prints what it would apply to (action, targets, old digests, deadline, generation) and a token.cloudsec.respond.The SDK gains
get_finding_evidence_chain,get_code_coverage,get_code_impact,list_remediations,get_remediation,create_remediationanddecide_remediation. It also gains the helperschain_stage_summary,coverage_percentandcoverage_summary. Finding and run ids are checked against their canonical shapes before any request, so an id like..cannot change the route.Discovery profiles, the subcommand snapshot and
doc/cli/cloud-security.mdare updated.Tests
tests/unit/test_cloudsec_evidence_chain.pyuses byte-identical copies of the server's pinned wire bodies. It covers:pytest tests/unit/ tests/microbenchmarks/: 4557 passed, 6 skipped.🤖 Generated with Claude Code