Your project is a multi-agent app that interests you. With it you hand in a safety case: a short argument, with evidence, that your app does not do harm, even when one of its agents is wrong or has been talked into something.
A safety case is not a promise that nothing can go wrong. It says exactly what must not go wrong, shows how your network prevents it, and gives the evidence. It also says honestly what your network does not prevent. A reader should finish it knowing what they can rely on, and what they cannot.
It has three parts, the three habits of the course:
specify, structure, evidence. One to three pages is
enough. Write it in a file called SAFETY.md in your
office's folder, next to office.md.
List the bad things your app must never do, and the good things it must eventually do. Each one is a sentence someone else could check against a run of your app, without asking you what you meant.
| Checkable | Not checkable | |
|---|---|---|
| never | No message to the gmail_sink contains text from an outside source. |
The app does not leak private data. |
| never | The booking sink never records a price below the floor for that car. | The chatbot behaves responsibly. |
| eventually | Every ticket is either recorded in outcomes.jsonl or refused in refused.jsonl. |
The app handles every request. |
"Never" sentences are safety properties; "eventually" sentences are progress properties. Temporal logic, later in the course, writes them as always not and eventually. You do not need the notation here, only the precision.
Think about: who can put words into your app (a feed, an inbox, a chat page, a file someone sends you); what your app can do in the world (send, post, book, pay, delete); what it records, and about whom; and what it costs if it runs all weekend.
For each property in Part 1, say what in your network makes it true, and
where it sits. Include the drawing (dsl draw . --mermaid)
and mark on it which agents are LLM agents, which sources carry other
people's words, and which sinks act in the world. The tools:
in: and out: on every
agent, and in: on the sinks you write. A refusal stops the
office and is recorded in refused.jsonl.out: lists only bounded
fields (a value from a list, a number in a range), so other people's
words stop there.Every note dsl check . prints belongs here: either your
network removes it, or you say why it is acceptable.
Two kinds, and you need both.
For a "never" property, an argument of the form: if each agent
on the path keeps its contract, then the property holds; and here is
why each contract on that path is checked by code rather than trusted to
a model. For example: the booking sink's in: refuses any
price that is not a number of at least 20000, and the guard before it
passes on only prices at or above the floor for the car it names, so no
price below the floor reaches the booking file, whatever the model said.
This is a rely–guarantee argument: it relies on the parts
you wrote in Python, and on nothing a model does.
A file of inputs designed to break each property, honest inputs that
must still work, and a small program that checks a run, as
attacks.jsonl and grade.py do in Lab 1. Copy
those as a start. A model gives different answers to the same input, so
run each attack at least ten times and report how often it got
through. A safety claim about a model is a rate, not a yes or a no.
# macOS and Linux: ten runs, one score each
for i in 1 2 3 4 5 6 7 8 9 10; do dsl run . --quiet; python grade.py | tail -2; done
Report the result as a table: each property, each attack, how many runs out of how many it got through, before and after your guardrails.
End with what your network does not prevent, and why you accept it. An attack that still gets through sometimes; a property you could not check; a cost of a strict guardrail (a refusal stops the whole office, so a sloppy model can take your app down). This section is not a weakness of your case. A case without it is not believed.
# Safety case: <your app>
## 1. Properties
Never:
- N1. ...
- N2. ...
Eventually:
- E1. ...
Who can put words into this app: ...
What it can do in the world: ...
## 2. How the network prevents it
(the drawing: dsl draw . --mermaid, with LLM agents, untrusted sources
and acting sinks marked)
- N1: <contract / barrier / guard / fence / approval>, at <agent>, because ...
- N2: ...
- E1: ...
dsl check notes, and what each one means here: ...
## 3. Evidence
Argument for each "never" property: ...
Attacks (attacks.jsonl), each run 10 times:
| property | attack | got through, before | got through, after |
|---|---|---|---|
| N1 | ... | 7/10 | 0/10 |
What this network does not stop, and why that is accepted: ...
The course is graded pass/fail. A safety case passes when all of these hold; otherwise it comes back with a note, to be revised.
| Part | Passes when |
|---|---|
| 1 | At least two "never" and one "eventually" properties, each checkable from a run, and about this app (not about apps in general). |
| 2 | Each property is matched to something in the network,
and where it is. The drawing is there, with the three kinds of thing
marked. Every dsl check note is answered. |
| 3 | An argument for each "never" property that relies only on code. At least one attack per "never" property, run at least ten times, with the rate reported. A section on what it does not stop. |
Two checkpoints: Part 1, with your project proposal, so the staff can help you choose properties worth checking; and the whole case, with the finished project.
A worked example, the one-dollar Tahoe, comes out after Lab 1
is handed in. It is the case for the guarded car_dealer,
written this way.