Skip to main content
View Markdown

How to verify the turnkey compliance report generator end-to-end

The compliance report generator is part of Talon's proof layer — reports are generated from the signed evidence records that budgets, policies, and routing decisions already produce, so verifying it means verifying that chain end to end. Use this checklist after upgrading Talon or before a release demo to confirm the Turnkey Compliance Report Generator (epic #109) still works: EU policy packs, the compliance HTTP API, the metrics snapshot cross-checks, and the signed control-plane evidence each export leaves.

This is the portable, repo-canonical version of the interactive verification canvas. The steps and expected outcomes are the same; work through the checkboxes here in any editor, terminal, or CI prep session.

Prerequisites: Go 1.22+, curl, jq, a free port 8080, and optionally a real LLM key to seed evidence. Run phases in order in one shell session — later steps assume the server and exports from earlier ones.

Learn the flow first? See the Turnkey compliance reports tutorial (~15 minutes, one happy path).

Time: about 45 minutes with all optional steps; ~25 minutes if you skip the wizard, smoke suite, and evidence seeding.


Phase 0 — Setup​

Build current main and prepare a clean workspace.

  • Not completed: Build the latest binary

    cd ~/tmp/dativo/talon && git checkout main && git pull
    go build -o /tmp/talon ./cmd/talon && /tmp/talon --help

    Expect: build succeeds; help text prints.

  • Not completed: Create a clean test workspace

    mkdir -p ~/talon-epic-test && cd ~/talon-epic-test

    Expect: empty directory; all following commands run from here unless noted.

  • Not completed: Export session keys (same shell for serve and curl)

    export TALON_SECRETS_KEY=$(openssl rand -hex 32)
    export TALON_ADMIN_KEY=test-admin-key

    Expect: both variables set. The admin key gates the metrics snapshot and all /v1/compliance/* endpoints.


Phase 1 — EU policy packs​

Compliance packs in talon init: catalog, wizard, scaffold, scripted, validation.

  • Not completed: Browse the pack catalog

    /tmp/talon init --list-compliance

    Expect: four packs (gdpr, nis2, dora, eu-ai-act), each with a description and supported articles, plus a disclaimer that packs support controls and are not a certification.

  • Not completed: Interactive wizard with pack multi-select (optional)

    Run /tmp/talon init interactively. Accept defaults until Apply EU compliance policy packs?, then enter 1,2 (GDPR + NIS2).

    Expect: summary shows Compliance packs: gdpr, nis2; agent.talon.yaml and talon.config.yaml are written.

  • Not completed: Inspect generated annotations

    head -30 agent.talon.yaml

    Expect: header # Compliance packs applied: … followed by supports: lines linking articles (e.g. gdpr Art. 30) to Talon controls and source files; compliance.frameworks lists the selected packs.

  • Not completed: Scaffold path with packs

    /tmp/talon init --scaffold --compliance gdpr,eu-ai-act --force --skip-verify
    head -30 agent.talon.yaml

    Expect: annotated header with both packs; eu-ai-act sets ai_act_risk_level and human_oversight; gdpr sets data_residency: eu.

  • Not completed: Scripted path, cross-pack effect

    /tmp/talon init --provider openai --name epic-test --compliance dora --force --skip-verify
    head -30 agent.talon.yaml

    Expect: header lists dora; merged policy carries DORA retention (5 years).

  • Not completed: Invalid pack is rejected

    /tmp/talon init --scaffold --compliance hipaa --force --skip-verify

    Expect: command fails with unsupported compliance pack "hipaa" naming the valid values.

  • Not completed: Merged config validates

    /tmp/talon init --scaffold --compliance all --force --skip-verify
    /tmp/talon validate

    Expect: all four overlays merged together; validate reports no errors.


Phase 2 — Serve with declarations​

Declare a controller identity, start the server, optionally seed evidence.

  • Not completed: Reset to a known config

    /tmp/talon init --scaffold --name epic-agent --compliance gdpr --force --skip-verify

    Expect: fresh agent.talon.yaml and talon.config.yaml.

  • Not completed: Declare the controller identity (feeds RoPA, clears warnings)

    cat >> talon.config.yaml <<'EOF'

    compliance:
    controller:
    name: "Example GmbH"
    contact: "privacy@example.eu"
    EOF

    Expect: block appended. RoPA exports name this controller instead of a placeholder warning.

  • Not completed: Start the server with the gateway enabled

    Use a second terminal with the same key exports, or background the process.

    /tmp/talon serve --port 8080 --gateway

    Expect: curl -s localhost:8080/health returns ok. --gateway is required for Phase 5: without it, /api/v1/metrics returns plain-text 404 (a common symptom is jq: Cannot index number on the "404" body). Works even when talon.config.yaml has no gateway: block — defaults apply.

  • Not completed: Optional: seed real evidence

    /tmp/talon secrets set openai-api-key "sk-..."
    /tmp/talon run "Say hello in one word"
    /tmp/talon audit list

    Expect: run completes; audit list shows signed records. Phases 3–5 also work against an empty store (zero counts, empty tables).


Phase 3 — Compliance HTTP API​

Admin-only /v1/compliance/*: coverage, exports, auth, control-plane evidence.

  • Not completed: Coverage JSON

    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/coverage" \
    | jq '{frameworks: [.frameworks[].framework], warnings: .declaration_warnings, note: .claim_note}'

    Expect: at least five frameworks (gdpr, eu-ai-act, nis2, dora, iso-27001); declaration_warnings has ropa and annex_iv keys; claim_note says the output is not a completed legal filing.

  • Not completed: RoPA export (HTML + JSON)

    curl -sOJ -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/ropa?format=html"
    grep -o "Example GmbH" talon-ropa.html | head -1
    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/ropa?format=json" | jq .title

    Expect: talon-ropa.html names Example GmbH; JSON title is Record of Processing Activities.

  • Not completed: Annex IV export

    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/annex-iv?format=json" | jq .title

    Expect: valid JSON whose title mentions Annex IV.

  • Not completed: Framework-filtered report

    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/report?format=json&framework=gdpr" \
    | jq '{framework, controls: (.controls | length)}'

    Expect: framework is gdpr; only GDPR control mappings.

  • Not completed: Auth and validation matrix

    curl -s -o /dev/null -w '%{http_code}\n' "localhost:8080/v1/compliance/coverage"
    curl -s -o /dev/null -w '%{http_code}\n' -H "X-Talon-Admin-Key: wrong" \
    "localhost:8080/v1/compliance/report"
    curl -s -o /dev/null -w '%{http_code}\n' -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/ropa?format=pdf"
    curl -s -o /dev/null -w '%{http_code}\n' -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/compliance/coverage?from=12-31-2026"

    Expect: 401, 401, 400, 400 — in that order. No key and wrong key rejected; format=pdf and malformed date rejected. (Tenant-key rejection is covered by smoke section 34 with a gateway agent configured.)

  • Not completed: Exports record signed control-plane evidence

    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/v1/evidence?invocation_type=control_plane&limit=10" \
    | jq '.entries[] | {id, action: .policy_decision}' | head -20

    Expect: one control-plane record per export above (compliance_export_ropa, compliance_export_annex_iv, compliance_export_report), each signed.


Phase 4 — Legacy browser surfaces are gone​

The embedded dashboards were removed; nothing in this checklist runs in a browser.

  • Not completed: No HTML dashboard at the root or under /dashboard

    curl -s -o /dev/null -w '%{http_code}\n' localhost:8080/
    curl -s -o /dev/null -w '%{http_code}\n' -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" localhost:8080/dashboard
    curl -s -o /dev/null -w '%{http_code}\n' -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" localhost:8080/gateway/dashboard

    Expect: 404, 404, 404.

  • Not completed: No admin key in the URL

    curl -s -o /dev/null -w '%{http_code}\n' "localhost:8080/v1/compliance/coverage?talon_admin_key=$TALON_ADMIN_KEY"

    Expect: 401 — only the X-Talon-Admin-Key header or Authorization: Bearer authenticates.


Phase 5 — Metrics snapshot cross-checks​

Budget, cache, spend breakdowns, denials-by-reason. Requires Phase 2 server with --gateway.

  • Not completed: Snapshot shape

    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/api/v1/metrics" | jq '{budget: .budget_status, cache: .cache_stats, by_agent: .agent_stats, by_provider: .provider_breakdown}'

    Expect: budget_status and cache_stats objects plus agent_stats / provider_breakdown arrays. Without gateway traffic, zeros and empty arrays are correct.

  • Not completed: CLI parity

    talon metrics --json --url http://localhost:8080 | jq '.[0]'

    Expect: the same agent_stats rows as the snapshot (same server, same collector).

  • Not completed: Denials by reason

    curl -s -H "X-Talon-Admin-Key: $TALON_ADMIN_KEY" \
    "localhost:8080/api/v1/metrics" | jq '.denials_by_reason'

    Expect: null with no denials, otherwise per-reason buckets (pii_block, policy_deny, session_budget_exceeded, …) sorted by count.


Phase 6 — Regression and cleanup​

Automated suites plus teardown.

  • Not completed: Full Go test suite (from repo root)

    cd ~/tmp/dativo/talon && go test ./...

    Expect: all packages pass.

  • Not completed: Smoke suite (optional; long-running)

    cd ~/tmp/dativo/talon && bash tests/smoke_test.sh

    Expect: SECTION 34 — Compliance API passes. Needs port 8080 free, curl, and jq.

  • Not completed: Cleanup

    kill %1 2>/dev/null; rm -rf ~/talon-epic-test

    Expect: server stopped (or Ctrl-C in its terminal); test workspace removed.


You're done​

You verified policy packs, the compliance API, the absence of the legacy browser surfaces, the metrics snapshot cross-checks, and (optionally) the automated regression suites.

I want to…Doc
Walk a new teammate through the happy pathTurnkey compliance reports tutorial
Export for a real auditor handoffCompliance export runbook
Understand each packEU compliance policy packs
Metrics snapshot field referenceGateway metrics API reference

Commands in this guide are aligned with tests/smoke_sections/34_compliance_api.sh and internal/server/handlers_compliance.go.