Documentation
¶
Overview ¶
Package remediation ports src/sec_af/agents/remediation.py — the agent that turns a finding into a concrete patch by running the coding harness against the repository.
The Python module exposes two entry points that build the SAME prompt template (src/sec_af/prompts/remediation.txt) from two DIFFERENT finding shapes:
- run_remediation(app, repo_path, finding: RawFinding, verdict, rationale) — the HUNT-shaped finding plus an externally supplied verdict/rationale (reasoners/prove.py run_remediation_agent);
- generate_remediation(app, repo_path, finding: VerifiedFinding) — the PROVE-shaped finding, whose location/proof/verdict/rationale are read off the model itself (reasoners/prove.py run_remediation).
Both then run the harness in a throwaway cwd with project_dir=repo_path and funnel the result through extract_harness_result(..., "RemediationAgent").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRemediation ¶
func GenerateRemediation( ctx context.Context, app appx.Harnesser, repoPath string, finding schemas.VerifiedFinding, ) (schemas.RemediationSuggestion, error)
GenerateRemediation ports src/sec_af/agents/remediation.py generate_remediation.
async def generate_remediation(app, repo_path, finding: Any) -> RemediationSuggestion """Adapts VerifiedFinding (location-based) to the prompt template expected by run_remediation."""
It is NOT a wrapper around RunRemediation in Python (the replacement table is duplicated inline) and is not one here either, so the two prompt builders can drift independently exactly as the Python ones can.
func RunRemediation ¶
func RunRemediation( ctx context.Context, app appx.Harnesser, repoPath string, finding schemas.RawFinding, verdict string, rationale string, ) (schemas.RemediationSuggestion, error)
RunRemediation ports src/sec_af/agents/remediation.py run_remediation.
async def run_remediation(app, repo_path, finding: RawFinding, verdict, rationale) -> RemediationSuggestion
The tempdir prefix is Python's f"secaf-{agent_name}-" with agent_name = "remediation", i.e. "secaf-remediation-" — the same prefix generate_remediation hardcodes.
Types ¶
This section is empty.