Skip to main content
This flow proves that the host can stop a tool call when the current agent permission does not allow it.

1. Create a bounded agent

After MCP setup, ask your assistant:
Create a Trusted Agent named guarded-demo. Allow read_proofs, deny send_message, and require human approval for irreversible actions.
The assistant uses neus_agent_create and returns the one required setup step when signing is still needed.

2. Load current permissions

Run this in the project where the host will enforce the decision:
Replace codex with cursor or claude for that host. The command writes the current neus.runtime-mount.v1 bundle to .neus/mount.json.

3. Evaluate before the tool call

For the permission above, send_message returns:
read_proofs returns ACTION_ALLOWED. An expired or missing permission fails closed. An irreversible action returns HUMAN_APPROVAL_REQUIRED when the permission requires approval.

Decision order

evaluateRuntimeAction applies the mounted permission in this order:
  1. Require a valid runtime mount and current permission proof.
  2. Apply deniedActions.
  3. Apply a non-empty allowedActions list.
  4. Require approval for an irreversible action when configured.
  5. Allow the host tool call.
The SDK evaluates one action. The host still owns the tool call and must stop when allowed is false. Runnable source: examples/guarded-agent-action.
Last modified on August 13, 2026