---
title: "Security lesson 1: The forge's record"
description: "Read the forge's record of what happened, from requests waiting for approval and the event stream to a compliance report built from signed receipts."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.forge.workreef.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Security lesson 1: The forge's record

**Time:** 20 minutes. **Track:** [security and compliance](https://docs.forge.workreef.dev/learn/#security-and-compliance). **Before this:** [developer lesson 1](https://docs.forge.workreef.dev/learn/developer/first-landing/).

By the end of this lesson you will be able to:

- say what the forge records, and what makes the record trustworthy;
- follow what happens as it happens, from the event stream;
- produce a compliance report for a period, and say what it is built from.

## What the forge records

The forge keeps a record of what it does that anyone it gives a copy to can check, without trusting the forge itself. Each record is a **receipt**: a statement of what happened, signed by the forge, kept in a log that cannot be rewritten without anyone noticing. Landings, sign-ins, agents' births, approvals and requests are receipts; every read is recorded too. See [What the forge records](https://docs.forge.workreef.dev/concepts/records/).

Start a forge, and give it something to record:

```console server
$ af-server --dev
...
```

```console check
$ source ~/af-dev/dev/env
$ 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 lyzzwzylpkysoqzyqukvwwusvmyvxmqq at commit a69d76146af9686ce11af913a2836572706ead41b135440e728f854ed7126cda
$ printf 'Only on-call engineers may deploy.\n' > POLICY.md
$ af submit
Submitted commit d06ab71215e6edb0f12a40e3a15c647457fe78d981da7d2403fa4dd404406db4, 1 edit in its last snapshot
```

```console eventually
$ af status
Change lyzzwzylpkysoqzyqukvwwusvmyvxmqq (landed) at commit d06ab71215e6edb0f12a40e3a15c647457fe78d981da7d2403fa4dd404406db4
```

## Requests

A change to who may do what, such as a role, a restricted folder or a key, is a **request**, signed by whoever asks. An administrator's takes effect at once, on their word, recorded as approved by no one else; anyone else's waits until someone qualified approves it, and `af requests` lists those that wait. A forge can require a second administrator as well (`af-server --two-administrators`), and then an administrator's request waits for another. Here nothing waits, before the grant or after it:

```console check
$ af requests
$ af grant dev@localhost approver --reason "the audit lesson"
done: it took effect at once, on your word as an administrator
$ af requests
```

## The event stream

`af events` prints what happens as it happens, each with its place in the stream, and runs until stopped. `--after 0` starts from the first event; here `timeout` stops it after two seconds, and says so with the status 124:

```console check
$ timeout 2 af events --after 0
1 submitted lyzzwzylpkysoqzyqukvwwusvmyvxmqq at d06ab71215e6edb0f12a40e3a15c647457fe78d981da7d2403fa4dd404406db4
2 landed lyzzwzylpkysoqzyqukvwwusvmyvxmqq as d06ab71215e6edb0f12a40e3a15c647457fe78d981da7d2403fa4dd404406db4
3 main moved to d06ab71215e6edb0f12a40e3a15c647457fe78d981da7d2403fa4dd404406db4
[124]
```

The submit, the landing, and main moving to the landed commit: what an agent's `wait` and a person's dashboard follow.

## A compliance report

An administrator produces a report for a framework and a period. It is built from the receipts in that period, as OSCAL assessment results that validate against NIST's schema, with an HTML page to read:

```console check
$ 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
$ ls ~/reports
soc2-report.html
soc2-report.json
```

The report lists what the period's receipts show for each area, and every exception. The grant you made is one, a change of a role that no one else approved, listed under least privilege and again under separation of duties; `sort -u` shows it once:

```console check
$ grep -o '[^"]*approved by no one[^"]*' ~/reports/soc2-report.json | sort -u
Exception: dev@localhost (5fad8da4a06edc6b6e55642b04a5e97684867eef6675640272eb87db5d6a51b1) came to hold approver: approved by no one else, an administrator's own word (2026-11-25T08:08:28.568Z, entry 4 of the organization's receipt log).
```

## Exercises

1. Produce the same period's report for ISO 27001.

   ```console check
   $ af report iso27001 --from 2026-01-01T00:00:00Z --to 2100-01-01T00:00:00Z --out ~/reports
   wrote /home/you/reports/iso27001-report.json and /home/you/reports/iso27001-report.html; the report's receipt is entry 6 of the log
   $ ls ~/reports
   iso27001-report.html
   iso27001-report.json
   soc2-report.html
   soc2-report.json
   ```

## Check your understanding

<details>
<summary>The grant took effect at once. What does the record say about that?</summary>

That it was approved by no one else: it took effect on your word as an administrator, as an administrator's request does unless the forge requires a second administrator. Compliance reports list each such change of a role or a restricted folder as an exception, as the report above did.

</details>

<details>
<summary>What can a reader check in a receipt without trusting the forge?</summary>

That the forge signed it, and that it is in the log: the log cannot be rewritten without anyone holding an earlier copy of it noticing.

</details>

## Next

[Security lesson 2: The identity tree](https://docs.forge.workreef.dev/learn/security/identity-tree/) follows every agent to the person who answers for it. [What the forge records](https://docs.forge.workreef.dev/concepts/records/) explains receipts, the log and reports in depth.

Source: https://docs.forge.workreef.dev/learn/security/the-record/index.mdx
