Managing provider credentials across agent projects is an ownership problem as much as a storage problem. You need to know which account a key belongs to, which projects may use it, what actions it permits, and how to revoke it without losing track of running work.
A shared tool layer can reduce the number of raw provider secrets each project handles. It does not remove the need for scoped application access and a clear credential lifecycle. This guide describes a practical design and identifies o11’s inspected source behavior separately from live supplier activation, which must be verified for the actual environment.
Separate three identities
Keep the human or team account owner, the provider connection, and the agent application’s identity distinct. The account owner controls the supplier relationship. The connection represents authorized access to that account. The application identity determines which agent project may use it.
If every project shares one provider administrator key, those responsibilities collapse. A developer cannot revoke one experiment without affecting the others, and usage attribution becomes difficult. A shared gateway with one unrestricted application key can reproduce the same problem at another layer.
Build a connection inventory with provider, account owner, environment, intended purpose, permitted operations, credential reference, rotation owner, expiration, and current status. Store a reference to the secret, not its value, in ordinary project records.
For customer-owned accounts, the connection must remain bound to the correct customer workspace. A project should not substitute a platform account when a customer’s credential stops working. The account-mode guide explains why those access paths need explicit selection.
Keep secrets out of agent context
The model needs an operation description and safe results. It generally does not need the provider’s raw key. Resolve credentials in the execution service, attach them to the approved destination, and redact echoed secrets from returned data and logs.
OWASP’s secrets-management guidance covers lifecycle responsibilities such as storage, access, and rotation. Apply those responsibilities to both provider credentials and the agent’s own application key.
Keep secrets out of prompts, screenshots, generated code examples, browser bundles, issue comments, and analytics events. Avoid logging full request headers. Redaction should cover structured fields and known credential locations rather than rely on a single regular expression after data has already spread through the system.
Treat third-party results as untrusted content. A page or tool response cannot instruct the agent to disclose credentials or change its authorization. The execution layer should enforce that boundary even if the model follows a misleading instruction.
Scope access by project and purpose
Issue separate application credentials for development, evaluation, and production. Scope them to the tools and actions each project needs. A read-only research agent should not inherit publishing or service-creation permissions because another project uses them.
GitHub documents fine-grained token controls, illustrating why permissions and expiration matter. Verify equivalent controls for each supplier rather than assuming every API key supports the same restrictions.
Keep spending authority alongside tool authority. A project may be allowed to call an image operation but only within an approved allowance. An unlimited key in a development environment can turn a retry bug into an expensive incident even when data access is appropriately scoped.
In o11’s current source, application keys are credentials attached to a service-credit card. The card’s active policy controls permitted tools, connections, actions, and recurring work; its budget controls the allowance. Rotation changes the credential without resetting the card’s identity, usage, or service history. This card is a spending authorization object, not a bank card. Confirm the deployed environment and exact operation before relying on supplier access.
Treat OAuth as a connection lifecycle
OAuth adds consent, callbacks, expiration, refresh, and revocation to the connection lifecycle. Do not model it as a permanent token pasted into an environment variable. Record who authorized the connection, which workspace owns it, and what scope was granted.
RFC 9700 provides current OAuth security guidance, including privilege restriction and protections for authorization flows. Use reviewed libraries and current provider documentation rather than inventing a flow from a generic example.
Handle refresh centrally and prevent concurrent refresh attempts from corrupting the connection. If reauthorization is required, expose that state to the user and pause only affected operations. Do not silently request broader scope or choose another account to keep the workflow moving.
Disconnect and revoke are related but distinct. Removing a local connection reference may not revoke the supplier token. Revoking the supplier token may leave local jobs and resources that need a cleanup path. Document both effects so users understand the action they are taking.
Rotate without losing operational context
Plan rotation as a controlled change. Identify consumers, create the replacement credential under the correct account, update the execution service, verify a permitted operation, and revoke the old credential after the transition succeeds. Respect suppliers that do not allow overlapping keys.
Keep credential versions or references with safe audit metadata, never raw values. This helps explain why a job created before rotation behaves differently from a new call. Preserve the account identity of owned resources so changing a key does not accidentally assign them to another customer.
For a long-running job, determine which credential is needed to check status, cancel, or download output. A new credential may work if it belongs to the same account and has the right permissions, but that behavior is supplier-specific. Verify it rather than assuming key rotation is transparent.
Have a rollback path that does not restore an exposed secret. If rotation fails for a routine reason, use an approved alternative credential or pause affected work with a clear recovery instruction. Security incidents and ordinary maintenance need different responses.
Make revocation a predictable product behavior
Revoking an agent key should prevent new authorized work according to the system’s policy. It may not cancel a supplier job already accepted or release a resource that requires a separate API action. Explain these boundaries in the management interface and recovery documentation.
Track queued work, accepted jobs, active resources, and unresolved charges separately. A revoked key can stop future renewals while an existing invocation still needs reconciliation. Do not erase evidence of that work when deleting access.
If a credential is exposed, revoke or rotate it through the responsible account, inspect the affected usage window, and remove it from retained artifacts where feasible. Deleting a string from the latest file does not establish that earlier copies are safe.
Keep the incident scoped. Disable the affected project or connection while preserving unrelated authorized work. The recovery guide describes why unknown outcomes need investigation rather than blind replay.
Attribute usage without leaking sensitive data
Record project, workspace, operation, connection reference, invocation identifier, timestamp, and cost outcome. This is enough to answer many operational questions without logging personal data or complete provider payloads.
Separate customer-account usage from wallet-funded usage. A zero wallet debit does not mean the supplier call was free; it may be billed directly to the connected account. Keep that distinction visible in cost reports and support tools.
For illustration, three projects could each have a $10 experimental allowance while using separate scoped keys. That structure does not guarantee a $30 total bill if the system excludes direct-account charges or persistent resources. The scope of each control must match the costs it actually enforces.
Review access periodically. Retire abandoned project keys, reassign ownership when teammates leave, and investigate connections with no clear purpose. The subscription inventory guide provides a parallel process for unused commercial commitments.
Use a small operational checklist
Before connecting another provider, answer: who owns the account, where is the secret stored, which projects may use it, what can they do, what can they spend, how does it expire, and how is it revoked? Add the exact recovery path for jobs and resources that outlive the credential.
Then verify the boundaries with focused checks under an authorized environment. A configuration file that looks scoped is not evidence that the server rejects an out-of-scope request. Record what was tested and what remains unverified.
Start with separate project identities and a connection inventory. Centralize repeated credential handling where it helps, while keeping customer ownership and supplier behavior explicit. The productive agent setup is the one that reduces manual key work without making permissions, costs, or recovery harder to understand.
Example: rotating an agent credential
Consider a fictional research agent using an o11 service-credit card with a defined budget and permitted tool set. Its application credential is due for rotation. The replacement should authenticate the same card. The card’s existing usage, outstanding holds, resource ownership, and policy remain attached to that identity.
The operator verifies the replacement under an authorized environment, updates the application’s secret reference, and revokes the old credential. New requests use the replacement. Existing invocations remain inspectable through the same card context, subject to current authorization. This is a proposed operational sequence, not a rotation performed for this article.
If the agent instead needs a larger allowance, rotation is the wrong action. An authorized budget or policy change should address that request explicitly. Creating a new key must not become a way to reset accumulated spend or bypass the original limits.
The same distinction helps incident response. A leaked credential requires revocation and investigation. Closing or pausing the card is a broader decision affecting new purchases and renewals, while accepted supplier work still needs settlement. Keep those actions separate in the runbook so an urgent credential change does not accidentally erase financial context or strand an existing job.





