Skip to main content
AgentGuardian emits two machine-readable report shapes: the canonical signed JSON (agentguardian-scan-v1) and SARIF 2.1.0 for code-scanning tool consumers. Both are deterministic (sorted-key), both are PII-redacted by default, and both surface the same underlying Scan model.

When to use this

  • You are writing a parser, dashboard, or gate against a report and need to know the exact field set.
  • You are debugging why a downstream consumer (GHAS, Sonar) rejected a SARIF file.
  • You need to know which fields are signed and which are advisory metadata.
A static reference report generated from a real scan lives at docs/_assets/sample-report.pdf. Open it to see the field set before you run your first scan.

Produce a report

Or regenerate any format from a stored scan:

JSON schema: agentguardian-scan-v1

Top-level keys in canonical (sorted) order:

Finding object

Every entry in findings[] carries the full attack record:

Sample JSON (header)

Signing model

When sign=True (CLI default), signatures.hmac_sha256 and signatures.ed25519 are computed over the canonical JSON of the payload with the signatures key removed. This makes signing idempotent: re-signing an already-signed payload reproduces the same bytes. Verifiers reconstruct the signed input the same way. To verify a report:
Expected output:
A signature alone proves only that bytes were not tampered. Provenance (who signed) requires a pinned trust anchor — without one, verify exits non-zero and prints UNANCHORED. Details in Signatures.

SARIF 2.1.0 schema

The SARIF emitter wraps a single run per scan: one rule per observed probe_id, one result per finding. The bundled SARIF 2.1.0 schema is enforced before the file is written — a malformed payload raises ReportError rather than persisting a file that downstream consumers would silently reject.

Top-level shape

Severity mapping

The AgentGuardian severity is mapped to SARIF’s level field as follows: Anything outside this set defaults to warning.

Result properties

Each result carries the verdict plus the metadata SARIF has no native slot for:

Rule properties

Each rule (one per probe_id observed) carries ASI / CSA / MITRE metadata so downstream consumers don’t lose taxonomy when SARIF is the only artifact they ingest:

Contract provenance (Stage 1B)

When a scan was authorised by a Rules-of-Engagement contract, four provenance keys are lifted onto runs[0].properties:
  • contract_sha256
  • contract_version
  • authorization_ref
  • environment
And the RoE budget envelope is surfaced under runs[0].invocations[0].properties:
  • budgets_granted
  • budgets_consumed
  • suppressed_tool_attempts
  • started_at
Absent / null values are omitted so the SARIF stays clean for partially-populated audits. run.invocations is always an array (SARIF 2.1.0 rejects a singular invocation key).

How JSON, SARIF, and bundles fit together

Schema versioning

Breaking changes to the JSON shape bump the schema string. Additive fields do not.

Next step