Skip to content
1Claw Academy
Curriculum/Agents & Access Control3 minIntermediate · Lesson 15 of 15

Capstone: design an access model

Capstone

Take a real brief and produce the identities, policies, and bindings a working system needs.

A logistics company is putting three agents into production. Design the access model. The brief is deliberately underspecified in the places real briefs are.

  • A quoting agent reads carrier rate cards and answers customer questions on a public web form.
  • A booking agent creates shipments through a carrier API, which is billed per call.
  • A reconciliation agent runs nightly, reads invoices, and writes a summary to an internal vault path.
  • One human operations lead owns all three. Compliance requires that any spend above 500 USD be attributable to a person.
Tip

Write your answer down before reading on. The value is in committing to a design and then finding out where it leaks.

Start with identity. Three agents, three identities, no sharing. That is not bureaucracy: the reconciliation agent runs unattended at night and the quoting agent takes input from the open internet, and when something goes wrong you need the audit trail to distinguish them. Give each its own environment tag, and lock the tag on the two that touch production.

Then scope. Work path by path rather than agent by agent, because the interesting question is which agent should not reach a path:

  • rates/** read for the quoting agent only. It never needs write, and it must never reach invoices.
  • invoices/** read for reconciliation only, with a deny on the quoting agent even though no allow would have matched it. The deny documents the intent and survives a later broad grant.
  • reports/** write for reconciliation only.
  • The booking agent gets no secret read at all, which is the interesting part.
  1. 1

    Give the booking agent a binding rather than a credential. It calls the carrier API through Execution Intents, so the key stays server-side.

    bash
    curl -s -X POST https://api.1claw.co/v1/agents/$BOOKING_AGENT/bindings \
      -H "Authorization: Bearer $ONECLAW_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "carrier-api",
        "binding_type": "http",
        "base_url": "https://api.carrier.example",
        "allowed_hosts": ["api.carrier.example"],
        "allowed_paths": ["/v2/shipments"],
        "credential_source": {
          "type": "vault_ref",
          "vault_id": "'$VAULT_ID'",
          "path": "providers/carrier/key"
        }
      }'
  2. 2

    Scope the quoting agent to exactly one prefix, and add the deny that documents what it must never reach.

    bash
    curl -s -X POST https://api.1claw.co/v1/vaults/$VAULT_ID/policies \
      -H "Authorization: Bearer $ONECLAW_TOKEN" \
      -d '{"principal_type":"agent","principal_id":"'$QUOTE_AGENT'",
           "path_pattern":"rates/**","permissions":["read"],
           "effect":"allow","priority":10}'
    
    curl -s -X POST https://api.1claw.co/v1/vaults/$VAULT_ID/policies \
      -H "Authorization: Bearer $ONECLAW_TOKEN" \
      -d '{"principal_type":"agent","principal_id":"'$QUOTE_AGENT'",
           "path_pattern":"invoices/**","permissions":["read"],
           "effect":"deny","priority":100}'
  3. 3

    Satisfy the compliance requirement with an approval policy rather than a hard cap, so large bookings reach the operations lead instead of failing.

    bash
    curl -s -X PATCH https://api.1claw.co/v1/agents/$BOOKING_AGENT \
      -H "Authorization: Bearer $ONECLAW_TOKEN" \
      -d '{"tx_approval_policy":{"min_value_usd":500,"action":"approve"}}'

Decide

Six weeks in, the operations lead asks for the quoting agent to also answer questions about past shipments, so it needs read access to invoices/**. They point out that the deny you wrote is now blocking a legitimate business need.

What do you do?

The pattern to take away: when a request arrives as "agent X needs access to Y", the useful question is what X actually needs to produce. Access is one way to get there and usually the widest one.

Concept

Notice what the finished design contains. Three identities, four path policies, one deny that documents intent, two bindings, and one approval threshold. Almost none of it is about encryption, which is where people expect secret management to live.

Check your understanding

3 questions
1

Why does the booking agent get no secret read access at all?

2

What does the deny on invoices/** achieve when no allow would have matched anyway?

3

Why is an approval policy preferred over a hard 500 USD cap for the booking agent?