[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3
SEQ. 4

Permissions & Access Control

🛡️ Safety & Guardrails10 min90 BASE XP

Least Privilege for Autonomy

The principle of Least Privilege is the single most important security concept for agents. An agent should have access to ONLY the tools and data it needs for its specific task — nothing more.

Permission Architecture

LayerControlExample
Tool AllowlistWhich tools can this agent call?Customer service bot: [search_kb, create_ticket] only
Parameter ConstraintsWhat values can tool parameters take?search_orders only for current user's orders
Rate LimitsHow often can tools be called?Max 10 API calls per minute per session
Budget LimitsMaximum token/cost spend per taskMax $0.50 per agent run, hard stop
Time LimitsMaximum execution durationAgent must complete within 5 minutes
Approval GatesHuman approval before sensitive actionsRequire approval before sending emails

Tool Scoping Pattern

// Bad: Agent has full database access
const tools = [database.query]; // Can SELECT, INSERT, UPDATE, DELETE anything

// Good: Agent has scoped, read-only access
const tools = [
  {
    name: "lookup_customer",
    execute: (args) => db.query(
      "SELECT name, email, plan FROM customers WHERE id = $1", 
      [args.customerId]  // Only this customer, only these fields
    )
  }
];
🛡️ Critical Rule: Never give an agent direct SQL access. Wrap every database operation in a purpose-built function that validates inputs, scopes queries, and logs all access. The agent should call lookup_customer(id), not db.query(sql).

Defense in Depth Checklist

  • ☐ Agent has ONLY tools needed for its specific task
  • ☐ All tool inputs are validated and sanitized server-side
  • ☐ Budget and time limits are enforced (kill switch if exceeded)
  • ☐ Sensitive actions require human approval (HITL)
  • ☐ All tool calls and responses are logged for audit
  • ☐ The agent runs in a sandboxed environment (no access to host OS)
  • ☐ API keys and secrets are NEVER included in the agent's context
SYNAPSE VERIFICATION
QUERY 1 // 2
What does 'Least Privilege' mean for AI agents?
Give the agent all tools so it can handle any request
Give the agent ONLY the specific tools and data access it needs for its task
Give agents root/admin access for flexibility
Let the agent decide its own permissions
Watch: 139x Rust Speedup
Permissions & Access Control | Safety & Guardrails — AI Agents Academy