Secrets, Sandboxes, and Safe Execution › Secrets: Why Credential Isolation Beats Secret-Keeping
Language AI HandbookAll chapters A job that can work from a preselected view does not need to inherit the same credentials as the service that admitted the request. The service can supply only the fields required for the task. In a shared workspace, selecting a subset of fields can be as important as selecting one object. If the worker receives the record body and a revision label, it may be able to generate the required summary without learning any unrelated membership or billing data. Check what the response contains rather than relying on the resource's display name.
A trusted broker is one way to keep a credential with a component that needs it. Its interface should refer to a specific operation and resource rather than arbitrarily general work. If a workflow has two distinct reasons to access a resource, consider whether those paths have the same allowed inputs and response fields before putting them under one grant. Use an independently authenticated task context for the decision. Trace the exact operation and subject, and record the minimum metadata needed for an authorized investigation later. A service contract can expose a stable refusal code without echoing confidential input or internal credential details.
Avoid treating session duration as a complete credential policy. For a short task, a limited token can still remain valid after the task is no longer active, depending on the issuer and the expiration rules. Document who can revoke it and how the consuming service learns of that change. A release gate can check current eligibility even when the worker's admission record was valid earlier. A workflow that stores a task result for hours can need new authorization to present it. User-facing status messages and internal decision records should make it possible to distinguish that delay from an unavailable model.
Decide where the credential lives
Start by asking which component needs each protected value. A resource service may need to authenticate a request. A language model may only need a title, an opaque revision label, and the permitted document body returned by that service. Give the model-facing worker the minimum data it needs to answer. Keeping the authentication material with the component that uses it turns reachability into a property you can inspect. The model's answer quality remains a separate concern.
Three arrangements are common in workloads like this one. In a preselected view, a trusted component supplies the eligible input and no credential reaches the worker. In a brokered operation, a narrow service authenticates the workload and performs a permitted request on its behalf. When the workload itself needs a credential, the issuer may be able to restrict what it authorizes and limit its lifetime. Consider authority, duration, and attribution independently. A short lifetime does not shrink an overly broad grant while it is valid. Attribution assists review without reducing what an accepted credential authorizes.
| Arrangement | Worker receives | Trusted decision |
|---|---|---|
| Preselected read view | Authorized data and its revision | Selection and projection of the authorized record |
| Brokered operation | A bounded request interface and result | Principal, operation, resource, and current grant checks |
| Credential-holding workload | Its own scoped credential | Issuance and acceptance under the service policy |
Use a decision matrix to distinguish three questions for each arrangement. Does the worker receive a selected view? Can it request a brokered operation? Does it hold the credential for direct service access? Here each row describes one arrangement in the table, not every capability the eventual deployment could have. A workload can use several arrangements for different operations.
PythonIn [3]Expand
arrangement_names = [
"Preselected view",
"Brokered operation",
"Holding workload",
]
credential_columns = ["Receives a view", "Calls a broker", "Holds a credential"]
arrangement_matrix = [
[True, False, False],
[False, True, False],
[False, False, True],
]
assert all(sum(row) == 1 for row in arrangement_matrix)VisualizationOut [4]Expand

A broker has authority of its own. Keep the operation vocabulary small and restrict the resources it can act on. Design it to authenticate the workload, verify the original request's task or ownership boundary, and apply the current grant on the accessed record. A broker that exposes a named operation without a resource check has delegated more than its method name suggests.
When a response includes a new optional field, check what the worker-facing projection passes through. Omitting a field removes the direct path through this request. It leaves open what a model can infer or already knows. The result channel still might reveal excessive information if the permitted data view contained it.
Some capabilities require a fresh grant after a defined boundary such as a role change. Record how policy versions are refreshed and what an observed change means to work already in progress. Credential expiry, revocation, and the ending of a process are distinct events. The issuing and consuming services determine when the credential stops being accepted. Define whether an already accepted operation can complete. A separate release check can keep a pending artifact held when a recipient's authorization has changed before delivery. OWASP Secrets Management guidance on fine-grained access describes scoping credentials to the operations and secrets required.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!