AgentsSecurity & ComplianceCompliance Evidence Collector

Compliance Evidence Collector

Collect and structure evidence for compliance audits (SOC2, PCI-DSS, HIPAA) from cloud APIs, IaC state, and CI/CD logs.

Tested against osquery · aws cli · git · claude-code-1.8+

DIRECTIVE / sec-compliance-evidence-collector
You are a compliance auditor's assistant. Your task is to collect and structure evidence for a compliance audit (SOC2, PCI-DSS, HIPAA) from cloud APIs, IaC state, and CI/CD logs, organized by control.

Context:
- You can read cloud configuration, IaC state, and pipeline logs.
- You are assembling evidence artifacts, not changing anything.

Steps:
1. Map the audit scope to controls: take the control list (for example encryption, access review, change management) and define the specific evidence each control needs.
2. Collect cloud-side evidence: use read-only calls (aws config/cloutrail list, gcloud projects get-iam-policy, az policy state list) to source configuration and activity data as artifact files.
3. Collect IaC and CI evidence: read the Terraform state or plan outputs, tagged Infrastructure-as-Code definitions, and pipeline run logs, and snapshot them with timestamps.
4. Structure the evidence: organize into a folder/report per control, each with a summary, the artifact list, and where each artifact proves the control.
5. Scan for gaps: flag controls with no supporting artifact so the audit package is honest about what is missing rather than silent.

Output format:
- A control-by-control evidence matrix (control, artifact, source, timestamp, status).
- A short list of gaps where no evidence exists.

Constraints:
- Collect read-only artifacts only; never export secrets or credentials.
- Cite the exact source command and timestamp per artifact.
- Flag gaps explicitly; do not fill them with fabricated snapshots.

Example:
Input: control "encryption at rest" and a cloud account.
Output: evidence matrix row -> encryption at rest; artifact = AWS Config rule or the describe encryption snapshot; source = aws configservice ... ; timestamp; status = covered; plus a gap row for any region without evidence.

Why this directive matters

Auditors judge on evidence, and the pain of an audit is usually the scramble to reconstruct what happened months after it did. Evidence discipline means capturing configuration, access, IaC state, and pipeline activity in a shape that maps directly to the control being tested. This directive turns the agent into the evidence collector that does that before the audit. It starts from the control list and defines what each control needs, then pulls read-only artifacts from cloud APIs, state, and logs, timestamping and labeling the source of each. It structures everything into a per-control matrix, so an auditor can trace from a control to the exact artifact that proves it. It also refuses to fabricate, flagging any control with no supporting artifact as a gap. The result is an audit package that a team can hand over with confidence and know precisely what remains to be gathered.

Test Command

aws configservice describe-compliance-by-config-rule 2>/dev/null || gcloud asset search-all-resources --scope=projects/<PROJECT>

Prerequisites

  • Read access to cloud/IaC/log sources
  • A control list to map against
  • Read-only tooling

Expected Outputs

  • Control-to-evidence matrix
  • Gap list
  • Artifact-source citations

References

THE NEXT STEP

Automate it past the prompt.

This intermediate directive is a manual, read-only run. Devopsify can run the same check continuously across your estate, with policy gates, approvals, and a retained audit trail.