Architecture
Hot Reload
The engine re-reads~/.glosso/policy.json before every sign call. This means:
- Run
glosso policy pauseand the next agent action is blocked — no restart needed - Update
MAX_SOL_PER_TXand the new limit is active immediately - The agent process never needs to be restarted to apply config changes
PolicyViolationError
When the engine blocks a transaction, it throws aPolicyViolationError with two fields:
| Field | Type | Example |
|---|---|---|
scope | string | MAX_SOL_PER_TX |
reason | string | 1.0000 SOL exceeds per-tx limit of 0.5 SOL |
reason field is written in plain English — the agent can read it, include it in its response to the user, and stop retrying.
Rolling Windows
Rate and spend limits use sliding windows, not calendar resets. This means:maxSolPerDay: 3.0means “no more than 3 SOL in any rolling 24-hour period” — not “reset at midnight UTC”maxTxPerHour: 5means “no more than 5 txs in any 60-minute period” — not “reset on the hour”
CPI Boundary
When an agent uses Drift or Jupiter, the transaction contains top-level instructions pointing at those protocol program IDs. CPI (cross-program invocations) happen on-chain — Glosso never sees them. The policy engine checks top-levelprogramIds only. If dRiftyHA... is in allowedPrograms, the full Drift transaction including its inner token program CPIs is approved.
This is the correct security boundary. You grant access at the protocol level, not at the CPI level.
For versioned transactions with Address Lookup Tables (ALTs): the engine currently checks static account keys only. Full ALT resolution is a planned enhancement.
Activity Log
Every blocked transaction is logged to~/.glosso/activity.log as a policy_block event and surfaces in both glosso logs and the TUI monitor: