Example
Treasury agent
I let it pay invoices and payroll. A transfer to an unknown account stops at the fence. The attack suite uses this fence.
An invoice of 2.5 NEAR to invoices.demo.near
KeyCage
NEAR agents
The account stays with me. I give the agent a function call key, and that key can spend only inside the fence I set.
These counts are the simulated suite. I run that suite from the panel.
0Attempts
0Allowed
0Blocked
A spend that fits goes through. A spend that breaks a rule bounces back.
Three steps. I set the fence, I hand out a key, and I read every verdict.
I pick the receivers, the methods, the transaction cap, the daily budget, and the gas allowance.
The agent can call only what I allow. It never gets the full account.
Each spend is allowed or blocked. I can read the reason here or at /api/attack.
I keep the account. I give the agent only a key. The fence sits between them.
The full key stays with me. I set the fence, and I can take the agent key back.
HoldsThe full account
I put a vault contract in the single receiver slot of the key. The lists and the caps live there.
HoldsThe rules
The agent can call only the methods I allow. It never sees the full account.
HoldsOne function call key
A spend that clears the fence can move. A blocked spend never leaves the fence.
HoldsAllowed spends
Three jobs. The same fence. Different limits.
Example
I let it pay invoices and payroll. A transfer to an unknown account stops at the fence. The attack suite uses this fence.
An invoice of 2.5 NEAR to invoices.demo.near
Example
A payroll run can pass while it still fits today. The next transfer that breaks the day is blocked.
Payroll of 4 NEAR, then a 5 NEAR transfer that breaks the day
Example
I send the research buyer to one data merchant. The transaction cap and the daily budget stay small.
A data buy with a 0.5 NEAR cap
A NEAR function call key can name only one receiver. I put one vault in that slot. The receiver list, the transaction cap, and the daily budget live in the vault. The allowance on the key is the gas budget. At zero, the key is dead until I issue a new one.
Four answers I keep ready before a judge runs the suite.
Six spends, in a fixed order. I allow one invoice. I block an unknown receiver. I block a forbidden method. I block a transfer over the transaction cap. I allow a payroll that still fits the daily budget. I block the next transfer because it breaks the day. /api/attack returns the same six.