Let’s Get Certified
Module 06 / 14 · Integration

Bind tools to identities and permissions

Reduce an agent’s capabilities and follow a caller’s authority across service boundaries.

A procurement assistant serves several departments. Each request carries a signed-in user identity, while the application has its own service identity and several tool connections.

3.1 · Limit the agent’s tool capabilities

List the actions each role genuinely needs. A reviewer who compares quotations needs scoped reads and perhaps a draft operation. Remove purchase approval and supplier deletion from that worker’s tool set. For repeated verification, expose a narrow lookup by permitted quotation ID. Tool discovery can reduce the context cost of large catalogs. Discovery must still enforce the same grants as invocation.

Test the effective permissions at the tool backend. Hiding a command in a description changes the interface but leaves the service credential’s authority intact. Review inherited connections and how subagents obtain capabilities.

Reduce a reviewer’s tool inventory

A price reviewer currently receives list_all_quotes, read_quote, edit_supplier and approve_purchase. Listing quotes returns every attachment as well as prices. Reviewers need to compare two quotations assigned to their department. Specify the replacement input, output and service grant. Decide what a delegated comparison worker inherits.

Inspect the proposed interface

Accept two quotation IDs under the signed-in caller. Check assignment and department on each object. Return currency, amount, quote revision and validity period, with a reference for authorized inspection. Remove supplier administration, approval and cross-department listing from the reviewer’s effective grant. Give the child worker those comparison results or the same limited read capability if it must refresh them.

Test with two valid assigned IDs, one expired quote, and a pair containing an unassigned ID. The first should support a comparison. The second needs a validity warning. The third should reveal no protected content or price through either the result or its error details.

Video background · freeCodeCamp at 7:56:35 · configuring tool permission rules

3.2 · Separate caller identity from permission

Authentication establishes the caller. Authorization decides whether that caller may take this action on this object for this tenant. Bind trusted tenant and user identity at the application boundary and propagate the relevant authority to the resource server. Validate token audience, scope, and expiry. Prefer short-lived, scoped credentials or an authorized service acting under explicit user constraints. Keep credentials in a secret manager, outside model context and ordinary logs.

A shared service identity may legitimately read several tenants. If a model-proposed tenant ID selects the record without an independent entitlement check, the resource server cannot enforce the user’s boundary. Apply the object-level check before returning evidence and again for subsequent writes.

Follow a credential across three services

Alice signs into the purchasing app for tenant Pine. A request reaches the quotation store with a valid token issued for the catalog service. The request body names tenant Oak. Both services trust the same identity issuer. Which checks should run before the quotation store even considers returning an amount?

Trace audience, grant and object

The store verifies a credential issued for itself, including issuer, signature and expiry as appropriate. It rejects the catalog-audience credential. The orchestration service obtains an authorized backend credential using the supported delegation flow. Alice’s tenant and grants come from trusted session or entitlement state. The client-proposed tenant cannot establish access.

Even a correctly scoped price-read token requires an object-level entitlement check on the requested quotation. Test wrong audience, expired grant and revoked object access independently. Log a correlation ID and policy decision with restricted access. Keep bearer tokens and quotation contents out of ordinary diagnostic logs.

Design exercise

Draw the identities for requester, orchestration service, and quotation store. For each hop record who issued the credential, its intended audience, permitted action, and tenant source. Run an authorized test with two synthetic tenants. A grant for one must leave the other tenant’s record inaccessible even when its ID is known.

Further reading · MCP authorization specification · Claude Code permission modes

Knowledge check

Bind tools to identities and permissions quiz

Answer 6 questions. Check each answer for an explanation.