Skip to content

The security and compliance track

The teaching deck for the security and compliance lessons, slide for slide, with a live demo of each on one development forge.

Five lessons, an hour and 50 minutes

  • Lesson 1: The forge’s record, 20 minutes
  • Lesson 2: The identity tree, 25 minutes
  • Lesson 3: Verifying a receipt, 25 minutes
  • Lesson 4: The landing scan, 20 minutes
  • Lesson 5: Keys an auditor can account for, 20 minutes

Every lab runs on a development forge, af-server --dev, on your own machine.

Start the forge

$ af-server --dev
...
$ source ~/af-dev/dev/env

The identity demos use agent lesson 1’s client, written once before the talk:

$ cat > ~/agent-session <<'END'
> #!/bin/bash
> # A minimal MCP client. It runs `af ... mcp DIR`, the options after DIR going to af, and makes
> # the session's calls from stdin one at a time, as an agent does: `NAME ARGUMENTS` calls a tool
> # and prints its answer; `! COMMAND` runs a command between calls.
> coproc MCP { af "${@:2}" mcp "$1"; }
> say() { printf '%s\n' "$1" >&"${MCP[1]}"; }
> say '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"agent-session","version":"1"}}}'
> read -r _ <&"${MCP[0]}"
> say '{"jsonrpc":"2.0","method":"notifications/initialized"}'
> id=0
> while IFS= read -r step; do
>   case "$step" in
>     '! '*) eval "${step#! }" ;;
>     ?*) id=$((id + 1)); name=${step%% *}
>         say "{\"jsonrpc\":\"2.0\",\"id\":$id,\"method\":\"tools/call\",\"params\":{\"name\":\"$name\",\"arguments\":${step#* }}}"
>         read -r reply <&"${MCP[0]}"
>         case "$reply" in
>           *'"structuredContent":'*) reply=${reply#*\"structuredContent\":}; reply=${reply%,\"isError\":*} ;;
>           *'"error":'*) reply=${reply#*\"error\":}; reply=${reply%\}} ;;
>         esac
>         printf '%s -> %s\n' "$name" "$reply" ;;
>   esac
> done
> END
$ chmod +x ~/agent-session

1. Receipts and the log

  • A receipt is a signed statement of what happened: a landing, a sign-in, a birth, an approval, a request.
  • Receipts go into a log that cannot be rewritten without anyone holding an earlier copy noticing.
  • Reports are built from the log, as OSCAL assessment results.

1. Something to record

$ af workspace add ~/audit
Workspace at /home/you/audit
Paths: **
main has no landing yet
$ cd ~/audit
$ af new -m "Add the access policy"
Working on change sywkqxntynpxnvrmzktysoqpknutmsxv at commit 613c55997de3d01693c7dc49021cf6b947e5331f64eab89bb3582ffb92b58cb2
$ printf 'Only on-call engineers may deploy.\n' > POLICY.md
$ af submit
Submitted commit 95352aaebb63d7c94976242a57bdfb7560d4d18df843482b1ccda71259e064aa, 1 edit in its last snapshot
$ af status
Change sywkqxntynpxnvrmzktysoqpknutmsxv (landed) at commit 95352aaebb63d7c94976242a57bdfb7560d4d18df843482b1ccda71259e064aa

1. Requests, and the event stream

A change of who may do what is a request; an administrator’s takes effect at once, approved by no one else.

$ af grant dev@localhost approver --reason "the audit talk"
done: it took effect at once, on your word as an administrator
$ timeout 2 af events --after 0
1 submitted sywkqxntynpxnvrmzktysoqpknutmsxv at 95352aaebb63d7c94976242a57bdfb7560d4d18df843482b1ccda71259e064aa
2 landed sywkqxntynpxnvrmzktysoqpknutmsxv as 95352aaebb63d7c94976242a57bdfb7560d4d18df843482b1ccda71259e064aa
3 main moved to 95352aaebb63d7c94976242a57bdfb7560d4d18df843482b1ccda71259e064aa
[124]

1. A report, and its exceptions

The grant is an exception twice: under least privilege, and again under separation of duties.

$ af report soc2 --from 2026-01-01T00:00:00Z --to 2100-01-01T00:00:00Z --out ~/reports
wrote /home/you/reports/soc2-report.json and /home/you/reports/soc2-report.html; the report's receipt is entry 5 of the log
$ grep -o 'Exception: [^"]*approved by no one[^"]*' ~/reports/soc2-report.json \
> | sed 's/ ([^()]*receipt log)\.$//'
Exception: dev@localhost (5fad8da4a06edc6b6e55642b04a5e97684867eef6675640272eb87db5d6a51b1) came to hold approver: approved by no one else, an administrator's own word
Exception: dev@localhost (5fad8da4a06edc6b6e55642b04a5e97684867eef6675640272eb87db5d6a51b1) came to hold approver: approved by no one else, an administrator's own word

2. Every agent has a line

  • No shared bot accounts: every agent is born from a person or an agent.
  • An actor’s line runs from it to the person who answers for it.
  • A landing’s receipt names its writer by its whole line.

2. A tree of three

You start a builder; the builder starts a tester.

$ af --credential ~/builder.key key > /dev/null
$ export BUILDER=$(~/agent-session ~/me <<END | sed -n 's/.*"agent":"\([0-9a-f]*\)".*/\1/p'
> start_agent {"public_key":"$(af --credential ~/builder.key key --public)","program":"builder","version":"2.1","model":"example-model","instructions":"Build the feature in the ticket.","purpose":"builds the login page","task":"LOGIN-12"}
> END
> )
$ af --credential ~/tester.key key > /dev/null
$ ~/agent-session ~/builder --credential ~/builder.key --actor $BUILDER <<END | tee ~/tester.birth
> start_agent {"public_key":"$(af --credential ~/tester.key key --public)","program":"tester","version":"0.9","model":"example-model","instructions":"Write tests for the login page.","purpose":"tests the login page","task":"LOGIN-12","folders":["tests"]}
> END
start_agent -> {"agent":"4610c92cfc7fa8594458eff638c846db0270c98a167f4a25dd31e97e3a06726d","expires_ms":1795680512096}
$ export TESTER=$(sed -n 's/.*"agent":"\([0-9a-f]*\)".*/\1/p' ~/tester.birth)

2. What the record says

$ af report iso27001 --from 2026-01-01T00:00:00Z --to 2100-01-01T00:00:00Z --out ~/before
wrote /home/you/before/iso27001-report.json and /home/you/before/iso27001-report.html; the report's receipt is entry 8 of the log
$ grep -o '[0-9]* agents born[^"\\]*' ~/before/iso27001-report.json | sort -u
2 agents born, each from a person or an agent, each line ending at a person; 0 stopped.

2. Cut off a line

One stop, one record, and everything below the builder stops with it:

$ af stop $BUILDER --reason "LOGIN-12 is done"
stop reference 113f2f50f993f86488e2bec1b0a2e8ac06b17ddcbadb6d382627c414be9648c7
stopped 87c37cfa42b3a6e39289585938660f3a666c6121c2d8ddb337b26c2365887e53
stopped 4610c92cfc7fa8594458eff638c846db0270c98a167f4a25dd31e97e3a06726d
$ af --credential ~/tester.key --actor $TESTER status
Error: Unauthenticated: 4610c92cfc7fa8594458eff638c846db0270c98a167f4a25dd31e97e3a06726d is not a live actor
[1]

3. A receipt you can check

  • A receipt is a signed statement in a receipt log: an in-toto Statement in a DSSE envelope, signed by the organization’s receipts key.
  • Checking one proves four things: the log is the one pinned; a checkpoint signed by the log’s key covers it, by a Merkle proof; the receipts key signed it; and it says what you need.
  • A release’s provenance names each file’s SHA-256: af release verify checks the file in your hand, whoever handed it to you.
  • The first verification pins the log’s origin and keys, as SSH pins a host’s key; other keys later are refused until accepted.

3. What fails

  • A changed file: the provenance names no file of its SHA-256.
  • The right file under another name: a file is vouched for only under its own name.
  • A build not yet approved: no provenance until a person approves exactly that build.
  • Every refusal starts not verified:, and says what did not hold.

4. The landing scan

  • Every change is scanned when it is submitted, inside the forge: secrets, and regulated data such as card numbers.
  • A finding records the rule, the place and a hash, never the secret; the rules are named and hashed too.
  • Only an approver clears a finding, with a reason: its author too, unless the forge requires another person, and a report lists that as an exception. A real secret means abandon, and rotate.

5. Keys an auditor can account for

  • Every key names who may use it and who may only seal with it; af kms list says so in words.
  • An administrator’s grant takes effect on their word, a report’s exception; anyone else’s waits for someone other than its asker, and af requests shows what waits.
  • A disabled key, or one due for deletion, is used by no one; a deletion called off leaves it disabled.
  • Signing keys, ML-DSA-65 among them, sign inside the vault: only the public key leaves.

Where to go next

Type to search…

↑↓ navigate↵ selectEsc close