TrustCyber / machine
/insights/ai-tool-access-patterns/index.mdtext/markdown7.3 KB ~1,869 tokens
Open raw

Where Should an Agent’s Tools Live?

Compare local functions, direct services, and shared gateways by ownership, enforcement, failure behaviour, and operating cost.

Canonical HTML page

A team building its first agent can expose a function directly and finish the integration quickly. A platform team supporting many agents may want a shared tool gateway. Both choices can be reasonable. The deciding factors are where authority is enforced, who owns the service, and what happens when a dependency fails.

Three architectures: a local tool within the agent runtime, a direct connection to a remote service, and a shared gateway routing to services.

Conceptual patterns. The protected service retains responsibility for business rules in all three designs.

Local functions: a compact operating boundary

An in-process tool shares the agent’s deployment and runtime. That can make a bounded workflow easy to understand, test, and support. One team can version the function and its caller together. The cost appears when several agents copy the same integration and gradually diverge in credentials, validation, and logging.

Treat the local call as a real business operation. Validate inputs, keep secrets out of model-visible context, and ensure the target system checks permissions. A function running nearby can still change a distant production record.

Direct services: ownership at the destination

A remote API or tool server can evolve independently of the agent. Its owner can enforce permissions, maintain a versioned contract, and scale the service for several callers. This is attractive when the target systems already have strong authorization and operational support.

The integration burden grows as more agents connect to more services. Teams need consistent ways to discover tools, delegate credentials, interpret failures, and correlate logs. A protocol can standardize communication while leaving these governance decisions unresolved.

The architectural tradeoff

PatternUseful whenOperating cost to examine
Local functionOne team owns a narrow workflowDuplicated controls as integrations spread
Direct remote serviceDestination has strong ownership and authorizationRepeated discovery, delegation and logging work
Shared gatewayMany agents need common policy and visibilityAvailability, latency, isolation and bypass prevention

Shared gateways: common control, common dependency

A gateway can provide a tool catalogue, apply policy, manage access, and standardize event records. AWS’s enterprise guidance identifies tool registries and access controls as governance concerns. A gateway is one implementation choice for those concerns; its usefulness depends on what it actually enforces.

Design the failure mode deliberately. If the gateway is unavailable, should the action wait or stop? If an agent still has a direct route and a broad token, the gateway may not control the operation. Tenant isolation and credential handling also need attention when several teams share the same component.

Keep business authorization close to the system with the necessary facts. A gateway may know that a caller can request a refund, while the payment service knows whether that particular transaction is refundable. Those checks complement each other when their responsibilities are clear.

Choose one action to compare

Hypothetical architecture decision ADR-06 compares sending the internal weekly report through three designs. Two agent teams need the same recipient approval rule. The mail service already supports scoped identities and request-status lookup; the shared platform has a named operator. These are scenario assumptions, not tested capabilities.

ADR-06 — the same send under three designs

OptionAuthority and credential boundaryFailure behaviour and operating dependency
Local functionEach agent team owns enforcement; credential stays in its runtime’s secret store.Mail outage holds the call; timeout requires status lookup before retry. Every team must maintain the rule and trace correlation.
Direct serviceMail-service owner validates scope and approval at its API; each caller holds a narrowly delegated credential.Service outage blocks sends. Callers must share request-ID and retry conventions; dependent on the destination supporting payload-bound approval.
Shared gatewayPlatform owner enforces common approval and holds downstream credentials; mail service still checks recipient/business rules. Agents have no independent send route.Gateway outage holds sends with no direct fallback. Status lookup precedes retry; adds a shared availability and isolation dependency.

Decision: conditionally choose the gateway for shared sends, subject to verifying approval binding, route isolation and stop behaviour before release. Keep local report formatting in-process. Prefer the direct service if it can enforce the same approval contract and common logs without the extra gateway; prefer a local integration if one team owns the whole bounded workflow. Platform owner owns ADR-06 review when those assumptions change. Latency and operating cost are unmeasured and must be assessed before committing to scale.

Take a consequential operation and draw its full path under each candidate design. Mark where credentials are obtained, permission is checked, an approval is attached, and the outcome is recorded. Then examine an outage and a retry. This makes the tradeoffs tangible before a platform choice spreads across the estate.

A mixed design may be appropriate: local utilities for bounded computation, direct calls to mature services, and a gateway for shared controlled operations. Keep the exception routes visible and test them. The architecture is easier to defend when each connection exists for a stated operational reason.

Choose a tool boundary your team can operate

Enterprise architecture advisory compares dependencies, enforcement responsibilities and operating tradeoffs.

Selected primary sources