liveBook · Manning

Credential isolation

As explained in Designing AI Systems

Credential isolation is a security technique that keeps credentials outside application code and limits their exposure to a protected execution boundary.

Hardcoding an API key in a tool couples application code to a secret and creates opportunities for exposure. Credential isolation keeps secrets in a protected platform boundary rather than in application code, logs, or error messages. A Tool Service retrieves and injects credentials when it executes a request. section 6.3.2

The pattern separates registration, provisioning, and execution:

  • Register a tool with a credential reference by name, not the secret value. section 6.3.2
  • Provision the secret out of band through a secure channel. The credential store applies separate access controls, encryption, and rotation policies. section 6.3.2
  • At execution, retrieve the credential inside the Tool Service and inject it into the outbound request. Sanitize the external response before returning it to the application. section 6.3.2
Listing 6.13 Tool registration references credentials by name, never by value
platform.tools.register(
    name="healthcare.scheduling.book_appointment",
    endpoint="https://api.clinic-scheduler.com/v1/bookings",
    credential_ref="scheduling-api-prod",    #A
)

The scheduling tool registers a credential reference without including the API key. section 6.3.2

# Credentials provisioned via CLI by operations team
$ platform credentials store \
    --name scheduling-api-prod \
    --type api_key \
    --rotation-policy 90_days \
    --allowed-tools "healthcare.scheduling.*"
# Value prompted securely, never passed as argument

Operations provisions the matching reference separately, scopes it to scheduling tools, and supplies the secret through a secure prompt rather than a command-line argument. section 6.3.2

Figure 6.6 Secure credential isolation and injection flow. When an application requests a tool execution, it passes only the operational arguments, remaining completely decoupled from the underlying authentication mechanisms. The Tool Service independently fetches the necessary API keys from the isolated Credential Store using the registered reference name. It then injects these secrets directly into the outbound HTTP request to the External API. Crucially, the external system's response is sanitized before being returned, ensuring that at no point do sensitive credentials traverse the application layer, appear in the Platform SDK, or leak into system logs..

The execution flow shows where the Tool Service retrieves and injects the secret and where the response is sanitized. section 6.3.2

Rotation updates the credential store, so the next execution uses the new key without an application deployment. Scoping adds defense in depth: a scheduling credential can be restricted to tools in the healthcare.scheduling.* namespace. section 6.3.2

Agent tools

Calendar and ticketing tools use references to an OAuth token and an API key held in the credential store. The agent application executes those tools without handling the raw credentials. section 10.6

How Designing AI Systems covers it

How deep it goes
Traces registration, out-of-band provisioning, injection, response sanitization, rotation, and credential scoping through a scheduling example.
Examples
Uses a scheduling API key and calendar and ticketing credentials to demonstrate references to separately stored secrets.
What you can do after
Operate/configure credential references, separate provisioning, rotation policies, and allowed-tool scopes for managed tools.
How it connects
Connects tool registration and access control with secret rotation, response filtering, and defense in depth.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Designing AI Systems. The section links point to the parts of the book it draws on.