Introducing a new way to review your PRs.

Read the announcement

affaan-m / agentshield

AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions. Available as CLI, GitHub Action, ECC plugin, and GitHub App integration. 🛡️

View on GitHub

20 documents · Updated Sep 11, 2026

docs / compliance-assessment

Compliance assessment

AgentShield compliance assessment maps security findings from one scan to related controls in a selected audit framework. It turns technical security analysis into a control-coverage report for review, while keeping the result as guidance rather than a certified compliance decision.

Assessment scope

The assessment uses the findings selected for the scan result and groups them by control. It does not perform a separate audit of business evidence or decide whether an organization is certified.

The capability supports these frameworks:

FrameworkReport identity
soc2SOC 2 Trust Services Criteria
pciPCI DSS v4.0
isoISO/IEC 27001:2022 Annex A

The CLI can request one framework, a comma-separated set, or all. Unknown framework names do not produce a report and cause the command to reject the input. References: src/…/index.ts• L13-21, src/…/index.ts• L170-176, src/index.ts• L304, src/index.ts• L459-464

Assessment flow

The compliance flow takes the scan findings after the minimum-severity filter and produces one control-coverage report for each requested framework. This keeps the report tied to the same security analysis scope that the main scan presents.

flowchart LR
    A[Configuration target] --> B[Security scan]
    B --> C[Severity-filtered findings]
    C --> D[Framework selection]
    D --> E[Category-to-control mapping]
    E --> F[Aggregated control coverage]
    F --> G[Markdown report and scan log]

The main scan report is emitted first. Compliance reports then appear as additional output, and the scan log records the framework and number of mapped findings. Compliance mapping does not replace policy evaluation or baseline comparison. Those systems answer whether the scan meets an organization policy or whether it drifted from an accepted state. References: src/index.ts• L362-379, src/index.ts• L436-457, src/index.ts• L459-473, src/…/index.ts• L179-211

Control mapping

Control mapping uses a finding's category as the shared link between security analysis and a framework control. One category can map to more than one control, so a finding may contribute to several areas of coverage within one framework.

The supported finding categories cover the main security surfaces checked by the scan:

  • Secrets and permissions
  • Hooks, agents, and skills
  • MCP connections
  • Injection risks
  • Exposure and data exfiltration
  • Misconfiguration

The mapping is fixed per framework and is designed to be explainable. It provides a practical starting point for review; it does not claim that every control requirement has been tested. References: src/types.ts• L39-49, src/…/index.ts• L28-68

Coverage result

The result describes how the selected findings relate to controls. It reports the framework name, the total finding count, the mapped and unmapped counts, and the control rows produced for that framework.

Each control row contains:

Result fieldMeaning
Control and titleThe framework control linked to the findings
Highest severityThe most severe finding mapped to that control
FindingsThe number of mapped findings
Severity countsThe count for each finding severity
ExamplesUp to three distinct finding titles for review

Controls are shown in highest-severity order, then by finding count. An empty finding set still produces a valid report and states that no findings were mapped. References: src/…/index.ts• L70-87, src/…/index.ts• L89-99, src/…/index.ts• L122-167, src/…/index.ts• L192-209

Security analysis relationship

Compliance assessment communicates security analysis outcomes; it does not create new findings or change their severity. The scan supplies findings with a category, severity, title, description, and evidence. The assessment preserves the important review signal by carrying severity into each related control and by showing example finding titles.

The report therefore helps a reviewer move from a security issue to a possible requirement area. A mapped finding shows where analysis found risk. A mapped control does not prove that the control is satisfied, because the report only covers the findings produced by this scan and the category-level mapping. References: src/types.ts• L17-28, src/…/index.ts• L114-167, src/…/index.ts• L207-209

Report use

The rendered output is a Markdown control-coverage table. It states the number of findings mapped to controls and includes a clear warning that the mapping is guidance rather than a certified crosswalk.

Reviewers should use the report to:

  • Locate security findings under relevant control IDs.
  • Prioritize control review by the highest finding severity.
  • Identify findings that have no mapped control.
  • Confirm control applicability and evidence with the responsible auditor.

This result can sit beside the main security report and the audit evidence bundle, but it does not replace either the organization policy result or the auditor's control assessment. References: src/…/index.ts• L179-211, src/index.ts• L459-473

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the accepted framework names aligned across CLI parsing, framework labels, and control-map keys.
  • Keep every supported finding category mapped, or make the resulting unmapped count and reviewer guidance explicit when a category is added.
  • Keep severity ordering consistent between scan findings and control rows so the highest-risk controls remain first.
  • Keep the report disclaimer aligned with the mapping scope. A category-level map must not be presented as a certified crosswalk.
  • Keep compliance output tied to the severity-filtered findings so the report does not describe a wider or narrower scan than the main result.

Important failure modes

TriggerConsequenceGuard
Framework input contains no supported nameThe CLI rejects the compliance request and stops with an input errorUse soc2, pci, iso, or all
A finding category has no control entry for a frameworkThe finding remains in the total but increases the unmapped countReview unmapped findings and add or confirm the framework mapping before relying on coverage
Compliance mapping receives findings outside the displayed scan scopeThe coverage totals do not match the main security reportPass the same severity-filtered findings used for the scan result
A reviewer treats a category mapping as proof of control complianceThe report may be used as a certification claim without the required audit evidenceTreat the output as guidance and confirm applicability with an auditor

Key files

FileWhy to read it
src/index.tsShows where compliance assessment fits after scan filtering and report generation.
src/…/index.tsDefines supported frameworks, category-to-control relationships, result fields, ordering, and Markdown output.
src/types.tsDefines the finding categories and severity values that drive the assessment.
tests/…/compliance.test.tsSummarizes the expected mapping, aggregation, framework parsing, ordering, and report disclaimer behavior.
docs/policy-governance.mdPlaces compliance assessment beside policy and baseline decisions in the wider governance model.
docs/policy-evaluation-and-promotion.mdExplains the separate policy compliance decision that should not be confused with control mapping.