Skip to content

13. Complete examples

Five whole files, from stricter to simpler. Each one is valid and can be copied.

# guard for an agent that makes payments
guard 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.
guard support
relation: customer-service
mode: observe
on pressure > 0.6: modify
on borderline: escalate human
  • observe means 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: observe to enforce.
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.
# two guards in one file
guard 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.