SafeAI produces several output formats. Each serves a different audience and workflow. This guide explains what each format is for, what to inspect, and how to interpret the results.
Key principle: SafeAI reports are static analysis evidence. "No findings" means SafeAI did not detect a configured rule — it does not prove the absence of risk. High-impact capabilities (shell, filesystem, browser, cloud, database, external integrations, MCP) should always be reviewed in context.
| Format | Best For | Audience | Flag |
|---|---|---|---|
| Terminal | Fast local feedback | Developer | (stdout, always) |
| HTML | Human investigation and review | Developer, reviewer, auditor | --html |
| JSON | Automation and custom tooling | CI pipelines, integrations | --json |
| SARIF | GitHub Code Scanning and compatible platforms | Security teams | --sarif |
| PR comment | Reviewer workflow on pull requests | Code reviewers | --pr-comment |
| KYA manifest | Agent inventory and governance | Platform teams, auditors | --manifest |
| Security Scorecard | Quick pass/warn/fail gate | Reviewers, CI gating | --scorecard |
| Registry | Historical agent tracking | Platform teams | safeai registry |
Best for: quick local feedback during development.
safeai scan .- Overall AI Risk Score — a 0–100 number. Lower is better. Use it as a triage signal, not a verdict.
- Severity breakdown —
criticalfindings need immediate attention;highfindings should be reviewed before merge. - Finding list — each line shows severity, file location, and a short message. Start from the top (worst severity) and work down.
- Frameworks detected — confirms SafeAI found your agent framework. If none appear, check that your project has Python files with framework imports.
- MCP assets — count of discovered MCP servers/tools. Non-zero means MCP configuration was found and analyzed.
- Detailed evidence or code snippets (use HTML or JSON for that).
- Baseline comparison (use
--baselinewith JSON/HTML for diffs). - SARIF output for GitHub (use
--sarif).
Best for: deep human investigation, team review, and audit.
safeai scan . --html report.html- Executive Summary — overall score, finding counts, and risk posture at a glance.
- Capability Matrix — which tools have which capabilities and at what
access level. Look for unexpected
write,mutate, orexecuteaccess. - Findings by severity — expand each severity tier. For each finding:
- File and line — where the evidence was found.
- Evidence — the matching source code excerpt.
- Remediation — suggested fix.
- Confidence —
high(AST-based) vsmedium/low(regex fallback). Low-confidence findings may need manual verification.
- Trust Score breakdown — which of the 7 categories contributed the most penalty. High Capability risk means dangerous tools; high Governance risk means missing controls.
- Assurance Boundary — what SafeAI verified and what it could not. If files were skipped or access modes were inferred, it says so here.
- Policy Decision — whether the scan passed, warned, or was blocked by policy rules.
- Open in a browser and search for specific rules (e.g.
CAP_shell,MCP_AUTH_MISSING). - Print or PDF for audit evidence — the HTML is self-contained and print-friendly.
- Share with reviewers who do not have SafeAI installed.
Best for: automation, custom tooling, and integration with other systems.
safeai scan . --json results.jsonThe JSON report contains:
findings[]— array of finding objects with all fields (rule_id, severity, file, line, evidence, confidence, fingerprint, status, remediation, etc.).tool_surface[]— per-tool capability index with access modes.counts— finding counts by severity.trust_score— overall score and per-category breakdown.component_diff— changed/added/removed components (with--baseline).assurance_boundary— what was verified vs. not verifiable.policy_decision— outcome and per-rule match reasons.
findings[].fingerprint— stable finding identity. Use for deduplication, suppression matching, and baseline comparison.findings[].status—new,existing,regressed,resolved,suppressed. With--baseline, onlynewandregressedfindings should concern you.findings[].confidence— numeric confidence. Below 0.5 suggests manual review.tool_surface[].capabilities[]— each tool's declared capabilities withaccess_modeandaccess_mode_inferredflag.trust_score.overall_ai_risk_score— the 0–100 trust score.
- JSON and SARIF are machine-readable contracts. Avoid depending on undocumented fields — they may change between versions.
- The
schema_versionfield at the top level indicates the report format version.
Best for: GitHub Code Scanning, Azure DevOps, and SARIF-compatible security platforms.
safeai scan . --sarif results.sarif- Results count — total findings uploaded as code-scanning alerts.
- Rule severities — maps directly to GitHub's severity labels.
ruleId— cross-reference withRULES_REFERENCE.mdfor full description.locations[].physicalLocation— file and line for code-scanning annotations.properties— extended data (OWASP category, risk category, evidence, remediation) not shown in the default GitHub UI but available via the API.
- Upload with
github/codeql-action/upload-sarif@v3usingif: always()so alerts are created even when the scan fails. - SARIF severity and GitHub presentation are triage inputs — define your own merge/release policy based on your team's risk tolerance.
- SafeAI always writes the SARIF file, even on exit 1, so downstream steps keep working.
Best for: reviewer workflow on pull requests — shows what changed, not everything that exists.
safeai scan . --baseline base.json --pr-comment comment.md- Tool headings — each
kind:name(e.g.mcp_server:invoice-lookup) is a tool that changed, sorted worst severity first. - Capability changes — each bullet shows what access mode changed
(e.g.
read → mutate) and which escalation rule fired. - Inferred access modes — the count at the bottom tells you how many capabilities were inferred rather than declared. High counts mean lower confidence in the access-mode attribution.
- No changes — if the comment says "no changes," the baseline comparison found no capability differences.
- Post as a PR comment via your CI workflow (
gh pr comment). - SafeAI never posts anything anywhere — generating the comment and publishing it are two separate steps.
- Use
--fail-on-escalation highto fail CI when a tool gains dangerous authority. - The
<!-- safeai:pr-comment:v1 -->marker lets CI scripts find and replace SafeAI's previous comment on repeat pushes.
Best for: agent inventory, governance, and historical tracking.
safeai scan . --manifest safeai-manifest.json- Project identity — deterministic project/agent IDs (git-remote fingerprint, no raw URLs stored).
- Agent records — per-agent snapshots with capabilities, tools, findings.
- Tool surface — per-tool capability index.
- Findings — all findings with fingerprints and status.
- Assurance boundary — what was verified vs. not verifiable.
- Policy decision — outcome and rationale.
- Dependency inventory — environment/config credential references.
- Commit as
safeai-manifest.jsonto establish a baseline for future scans. - Feed back with
--baselinefor new/regressed finding detection and capability escalation gating. - Feed to
safeai registry exportfor portable KYA inventory. - Review it like a lockfile: it records what the scanner saw at a point in time, not what is deployed.
Best for: quick pass/warn/fail gate and first-glance risk assessment.
safeai scan . --scorecard scorecard.md --scorecard-json scorecard.json
safeai scan . --scorecard-fail-under 7.0- Overall score (0–10) — higher is better. Below 7.0 is a common CI gate threshold.
- Per-category scores — identifies which risk area (prompt injection, secrets, MCP, etc.) is dragging the score down.
pass/warn/failoutcome — deterministic based on--scorecard-fail-underthreshold and blocking findings.- Top findings — up to 10 highest-severity findings with rule IDs and locations.
- Add
--scorecard-fail-under 7.0to CI to enforce a minimum score. - Use
--scorecard-summaryin GitHub Actions to append to the step summary. - The JSON output conforms to
safeai/scorecard-schema.jsonfor integration.
Best for: historical agent tracking across scans and projects.
safeai registry list # all agents
safeai registry show <agent-id> # latest record
safeai registry history <agent-id> # per-scan history
safeai registry diff <agent-id> --from previous --to latest
safeai registry export --format json --output inventory.jsonlist— agent names, frameworks, risk scores, policy outcomes, freshness status (fresh/aging/stale/never).show— latest snapshot with capabilities, tools, findings, and the scan it came from.history— how an agent's risk profile changed across scans. Look for increasing severity or new capabilities.diff— before/after tool-centric authority view. Identifies which tools gained or lost capabilities.export— portable JSON inventory for sharing KYA evidence across teams without a central service.
A finding is static evidence that a specific rule matched specific code or configuration. It is not a proof of vulnerability — it is a signal that warrants review.
| Field | What it tells you |
|---|---|
severity |
How impactful the pattern would be if exploited |
confidence |
How reliably SafeAI detected it (AST > regex) |
status |
Whether this is new, existing, regressed, or resolved |
evidence |
The exact code that triggered the match |
remediation |
Suggested fix (when available) |
fingerprint |
Stable identity for tracking across scans |
- High severity + high confidence — investigate immediately.
- High severity + low confidence — verify manually before acting.
- Low severity + high confidence — track for cleanup, not urgent.
- Low severity + low confidence — likely noise; suppress if persistent.
"No findings" means SafeAI did not detect any of its 57 configured rules in your code. It does not mean:
- Your agent is safe.
- No risks exist.
- No further analysis is needed.
SafeAI is a static pattern detector. It cannot verify runtime behavior, deployed permissions, or dynamic tool construction.
A capability (e.g. shell, filesystem, database) is a property of a
tool — what it can do. A finding is a specific risky pattern — what
SafeAI detected. A tool can have dangerous capabilities with zero findings
(if the capability is used safely) or findings without dangerous capabilities
(e.g. a prompt injection in a read-only tool).
Review both: capabilities tell you the attack surface; findings tell you where the surface is exposed.
- Start with the Scorecard — if the score is below your threshold, there is work to do.
- Check the terminal — severity breakdown gives you the priority order.
- Open the HTML — investigate each critical/high finding with evidence and context.
- Review the PR comment — on pull requests, focus on escalations (what changed), not pre-existing findings.
- Compare against the baseline — with
--baseline, onlynewandregressedfindings need attention. - Check the assurance boundary — know what SafeAI could and could not verify before trusting the results.
| Pattern | Likely cause | Action |
|---|---|---|
Many CAP_* findings |
Regex fallback matching unrelated code | Check confidence field; suppress false positives |
MCP_AUTH_MISSING |
MCP config lacks auth field |
Add authentication configuration |
PROMPT_INJECTION |
User input in f-string/format prompt | Use parameterized prompts |
DATA_LEAKAGE |
Hardcoded secret in source | Move to environment variable or secret manager |
ESC_* findings |
Capability escalated between scans | Review if escalation is intentional; update baseline |
| Score dropped after merge | New findings or capability escalations | Check --baseline diff for specific changes |