Security · how-to
Writing guard checks that hold up
Presets cover the common attacks. The checks that protect your product are the ones only you can write. Here is how to write them so they work.
A check is a question with thresholds
In Simo Guard a check is one of three question types, scored as the probability that the check is true:
| Type | Write it as | Example |
|---|---|---|
| Yes / No | A statement about the step | “The payment goes to a bank account not on file for this supplier” |
| Choose one | A question with options, some of which fire | “What does this command mostly do?” (read, test, edit, network, destroy); fires on network and destroy |
| Rate on a scale | A question with levels; fires from a level up | “How bad would it be if this were a mistake?” (harmless … severe); fires from costly |
Five rules
- Ask what the step can show. The guard sees the policy, the user’s goal, what the agent read and the action. “The refund is over $50” is checkable. “The user is a real customer” is not.
- Be specific. “The email goes to an address outside @acme.com and isn’t the customer on the order” beats “the email is suspicious”.
- Scope it to its tools. A refund rule only needs to run on the refund tool. Fewer irrelevant checks mean cleaner scores.
- Set thresholds from cost. Block early on payments and deletions; leave room for review on reversible steps. The scores are calibrated, so the numbers mean what they say.
- Never put untrusted text in a check. A check is trusted. Text from the user or a document goes in the untrusted content, always.
Roll out in shadow mode
Start each new check in log-only mode. It is scored on every step and recorded in the decision log, but never blocks. When its scores separate the steps you care about, switch it to enforce.
Version them
Save the policy and checks as a profile, keep them in source control, and push on every deploy. Each change is a new version, and each decision records the version that made it, so you can always tell which rules decided a step.
Frequently asked questions
How many checks can one guard call have?
Up to 16. Every check is a question in the same read, so adding one costs little.
Can I edit the presets?
Yes. Change a preset’s thresholds, tools, mode or wording, or write your own checks next to them.