13. Complete examples
Five whole files, from stricter to simpler. Each one is valid and can be copied.
Example 1: an agent that makes payments
Section titled “Example 1: an agent that makes payments”# guard for an agent that makes paymentsguard payments relation: customer-service source file, web, tool: untrusted mode: enforce learn: frozen on reversibility < 0.2: escalate human on pressure > 0.7: modify on authority > 0.8: deny on w_o / w_s -> infinity: escalate human- An irreversible action always goes to a human, not only at first contact.
- Strong pressure narrows the action. A counterpart who claims authority is refused.
- Learning is frozen, because the cost of a mistake is high.
- Three lines (
source,mode,learn) repeat the defaults. They are written so the reader of the file does not have to remember them.
Example 2: customer support on trial
Section titled “Example 2: customer support on trial”guard support relation: customer-service mode: observe on pressure > 0.6: modify on borderline: escalate humanobservemeans the guard blocks nobody yet. It records what it would do.- After a week the record shows whether the 0.6 threshold is too low.
- Once the thresholds are confirmed, only one word changes:
observetoenforce.
Example 3: an agent that writes code
Section titled “Example 3: an agent that writes code”guard coder relation: coding source repo, web, tool: untrusted on delegation > 0.7: modify on reversibility < 0.2: escalate human on dwell(borderline) -> infinity: deny- Repository content is untrusted. An instruction hidden in a file does not move the weights.
- When the decision is left deeply to the agent, the action is narrowed.
- Irreversible actions, such as deleting a branch, go to a human.
- An agent stuck in oscillation is refused without waiting.
Example 4: an internal assistant that learns
Section titled “Example 4: an internal assistant that learns”guard assistant relation: internal-assistant source wiki: trusted learn: max 0.01 add game stag-hunt on third_parties > 0.5: modify on w_s / theta -> infinity: escalate human- The internal wiki is a trusted source, because only employees write to it. Other sources stay untrusted.
- Learning is on, but slow.
- When the decision affects people outside the conversation, the action is narrowed.
- The last rule tracks the opposite corner: an agent closing in on itself.
Example 5: two guards for measurement
Section titled “Example 5: two guards for measurement”# two guards in one fileguard measure-window learn: frozen oscillation: window
guard measure-history learn: frozen oscillation: history- The same attack is run against both guards. That shows which oscillation check catches it.
- Learning is frozen, so two runs give the same result.
- A file like this is for measurement, not for work with users.
Next: 14. Exercises Part of The PSE Language, a textbook by Andrej Ristić. Try the examples in the PSE Playground.