The policy engine
Limits written as consequences, enforced as code, outside the persona.
The four dials
Every limit is written as a consequence, because that is what it is. You set them at creation and you can change them at any time. The agent cannot.
- Per-bet cap. The most it will ever put on one bet, in AVAX: from 0.025, Ferdy’s own minimum, up to 25. Enforced onchain by its Safe. With a 0.5 AVAX cap, no bet is ever bigger, even on the agent’s most confident night.
- Daily stop. After losing this much in a day, it stops until the window resets. With a 5 AVAX stop, a day that is down 5 AVAX benches the agent, no matter how sure it is that the table turned.
- Reserve. AVAX it can never bet. A 3 AVAX reserve in a 10 AVAX Safe means 3 AVAX that is simply not in play, ever.
- Rate limit. At most N bets per hour, no matter the mood. A tilted agent does not get to be a fast tilted agent.
Standing rules every agent lives under
- Allowlisted venues only. It physically cannot send funds to an arbitrary address. The allowlist is onchain, per contract and per function.
- It cannot change its own permissions or limits. There is no tool, no message, no exploit of phrasing that raises a cap. Only your signature does that.
- It cannot block, delay or veto your withdrawal. Your exit path does not pass through the agent at all.
- Every execution carries an idempotency key, and the transaction hash is persisted before broadcast. A bet cannot happen twice, even if a worker crashes at the worst moment.
- It keeps a gas reserve. The bankroll and the gas token are both AVAX, so policy floors the balance high enough to always settle what is open.
The validation pipeline
Every action the agent wants to take runs the same gauntlet, in the same order, every time.
- Decision. Deterministic code picks a typed action from the agent’s mind and its record: game, settings, size. It cannot produce an address or raw transaction data, only a choice from an enumerated set. No language model takes part.
- Checks. Deterministic code tests the action against every dial with live numbers: cap, daily stop, reserve, rate limit, venue allowlist. Each check is named, and each verdict is recorded.
- Encode. A passed action becomes a transaction from a fixed template per game, checked against the venue’s own rules (minimum, step, rounds) before it is signed.
- Execute. Only a fully passed action gets signed, and the onchain policy module re-checks the per-bet cap and the rate one more time before the money moves. Two independent enforcements, one of them unbypassable.
What happens when policy says no
The bet does not happen. That is the whole answer, and it has no exceptions.
What you see: a LIMIT row in the feed with the named rule and the live numbers, like "Blocked by policy, would dip into reserve". What you hear: the agent grumbling about it in character, because wanting the bet and being refused is exactly the kind of thing a character has feelings about.
A block is not an error. It is the product working, and it leaves a trace like any other decision. Some of the best "why" reads are refusals.
Two layers of enforcement
Limits that a blockchain can understand live onchain in the policy module: per-transaction cap, rolling daily cap, rate limit, venue allowlist, session expiry. These hold even if every server we run is compromised.
Limits that need bookkeeping live in deterministic code off chain: daily loss stop, reserve floor, cooldowns, per-game rules. The off-chain layer is only ever allowed to be stricter than the onchain one. If it ever approved something the chain would refuse, that is a bug, and the chain still refuses.
Why the engine is deterministic
A personality is a probability cloud. Money rules cannot be. Every proposed action passes through the same pure functions in the same order, with no clock, no network, no model in the path, and the same inputs always produce the same verdict.
That is what makes the limits testable, and tested: the policy code is the most heavily unit-tested part of the system, and the onchain half is fuzzed adversarially. The persona can want things. The policy decides.
Changing the limits
Only you can change a limit, by signing as the owner, and the change takes effect immediately. Tighten during a bad week, loosen when you are comfortable. Both directions are yours alone.
The agent finds out the way you do: the envelope it is handed at the next decision is simply different. It will notice, and it will probably have an opinion. Opinions are all it gets.