Run a security audit
Use SecurityAuditWorkflow when you want to scan a codebase for vulnerabilities — including eval/exec usage, path traversal, hardcoded secrets, and injection risks — and receive a severity-grouped report with actionable remediation steps.
Prerequisites
- Access to the project source code you want to scan
- The
attunepackage installed with theworkflowsandsecuritymodules available
Run the audit
-
Import and instantiate
SecurityAuditWorkflow.from attune.workflows.security_audit import SecurityAuditWorkflow workflow = SecurityAuditWorkflow()Pass
system_prompt_suffixif you want to append additional instructions to the orchestrator prompt:workflow = SecurityAuditWorkflow(system_prompt_suffix="Focus on authentication code only.") -
Call
execute()with the path to scan.result = workflow.execute(path="src/")The workflow coordinates four specialized subagents —
vuln-scanner,secret-detector,auth-reviewer, andremediation-planner— and synthesizes their output into a single report. -
Inspect the returned
WorkflowResult.The report contains three sections:
- Summary — an overall security score (0–100) and a brief executive summary
- Security — consolidated findings grouped by severity (
CRITICAL,HIGH,MEDIUM,LOW) - Suggestions — prioritized remediation steps with estimated effort per fix
-
Run the audit from the CLI (alternative to the Python API).
attune workflow run security-audit --path "src/"The CLI produces the same severity-grouped findings with CWE identifiers.
Verify success
The audit completed successfully when WorkflowResult contains all three report sections — Summary, Security, and Suggestions — and the Summary section includes a numeric security score. If findings exist, they appear under Security with at least one severity label (CRITICAL, HIGH, MEDIUM, or LOW).
Key files
src/attune/workflows/security_audit.py—SecurityAuditWorkflowand its four subagent definitionssrc/attune/security/—SecretsDetector,PIIScrubber,AuditLogger, and related detection primitivessrc/attune/monitoring/alerts_cli.py— CLI commands (watch,history,metrics) for monitoring audit-related telemetry thresholds