Glossary

Scoped credentials

Scoped credentials are authentication material whose usable authority is restricted by resource, action, environment, tenant, or time, so an agent receives only the access needed for a specific run or tool call and loses that authority when the assigned work or validity window ends.

How it works

Scoped credentials bind authentication to a deliberately narrow authorization envelope. Instead of giving an agent a reusable account secret with broad access, the harness obtains or selects credentials for the specific operation being attempted. The restriction may be enforced by the credential itself, by the authorization service that interprets it, or by both.

A typical control path is:

  1. The harness identifies the requested action, target resource, and run identity.
  2. Policy determines the smallest acceptable permission set and validity window.
  3. A credential broker issues or retrieves credentials matching that scope.
  4. The tool receives the credential only when it executes the approved call.
  5. The harness records issuance, use, expiry, and the run or actor responsible.
  6. The credential expires or is revoked when the bounded task ends.

Useful scope dimensions include read versus write access, allowed operations, resource identifiers, tenant or repository boundaries, deployment environment, and duration. These controls should be derived from authoritative workflow state, not from the model's description of what it intends to do.

The model may request authority, but it should not define or expand that authority. Scope construction belongs to deterministic policy and trusted harness code.

Why it matters in an agent harness

An agent can choose tool calls dynamically, misunderstand context, or act on hostile instructions found in retrieved data. Scoped credentials limit what those failures can reach. They turn a broad promise such as “the agent should only update this issue” into an authorization boundary enforced outside the model.

The first benefit is failure containment. A credential that can edit one repository cannot silently modify every repository available to the operator. A token limited to reading production state cannot turn a diagnostic run into a production mutation. Time limits also reduce the value of credentials accidentally retained in logs, subprocesses, memory, or abandoned execution state.

The second benefit is legibility. Scope can become part of the run contract and execution trace. An operator reviewing a call can see not only what the agent attempted, but what authority was available at that moment. That distinction matters when diagnosing a denied action, an unexpected mutation, or an unknown outcome.

Scoped credentials also improve approval design. A gate should approve a concrete authority increase, not a vague continuation request. For example, moving from repository read access to write access is a meaningful checkpoint. Approving “continue” while the agent already holds a broad credential adds ceremony without reducing risk.

There is a real operating cost. Narrow credentials require policy definitions, issuance paths, rotation, attribution, and handling for expiry during long-running work. Excessively narrow scopes can fragment workflows and create repeated authorization failures. The right boundary is therefore not the smallest scope imaginable. It is the smallest scope that permits the declared unit of work while containing plausible mistakes.

Scoped credentials are not a complete security model. They do not validate the correctness of an action, prevent misuse within the allowed scope, or make an irreversible write reversible. They work with approval gates, sandboxing, deterministic checks, audit trails, and recovery controls.

Scoped credentials vs scoped permissions

The terms are related, but they affect different parts of the design. Scoped permissions describe the authority policy. Scoped credentials are the mechanism presented when exercising authority under that policy.

QuestionScoped credentialsScoped permissions
What is bounded?The authentication material and authority usable through itThe actions and resources an identity or role is allowed to access
Where does it appear?Credential issuance, brokering, injection, expiry, and revocationAuthorization policy, roles, grants, and enforcement rules
Main failureA broad, reusable, leaked, or misattributed credentialA policy grant that is broader than the work requires
Harness decisionWhich credential may reach this tool call, and for how longWhich actions the run is eligible to request

A well-scoped policy does not help if the harness injects a different broad credential. Likewise, a short-lived credential remains dangerous if its permissions cover unrelated resources. Production harnesses need both layers to agree.

The Rifty take

We treat credentials as per-task capabilities, not ambient properties of an agent session. We accept some issuance and policy overhead to make authority visible, attributable, and short-lived. When a workflow needs more authority, the harness should cross an explicit control boundary rather than quietly inheriting it from the operator's environment.

Implementation checks

  • Derive credential scope from trusted workflow state and policy, never solely from model output.
  • Separate read, write, administrative, and destructive authority where the provider permits it.
  • Bind credentials to the narrowest practical resource, tenant, repository, or environment.
  • Set expiry according to the expected task duration and define how resumable runs reacquire access.
  • Inject secrets at execution time instead of placing them in prompts, context bundles, or durable transcripts.
  • Record which run, tool call, policy decision, and approval caused each credential to be issued.
  • Verify that child agents and subprocesses do not inherit credentials without an explicit delegation rule.
  • Test denied operations as well as permitted ones. A scope boundary is unproven until an out-of-scope call fails.
  • Treat unexpected expiry, revocation, or authorization failure as a visible operational state rather than silently substituting broader credentials.
  • Revoke credentials when work is cancelled, interrupted, or completed, even if their nominal expiry is later.

Frequently asked questions

Are short-lived credentials automatically well scoped?

No. Short lifetime limits how long a credential can be abused, but it does not limit which resources or actions are reachable during that window. A useful credential combines a bounded duration with narrow permissions, resource restrictions, and attribution to the run or tool call that requested it.

Should an agent be allowed to request broader credentials?

An agent may request an authority increase, but trusted policy should decide whether it is permitted. The request should name the action, resource, and reason. Any approval should authorize that concrete scope change, while credential issuance and injection remain under deterministic harness control.

How should scoped credentials work with long-running or resumable agents?

Persist the authorization decision and credential requirements, not the secret itself. When execution resumes, the harness should re-evaluate current policy and obtain fresh credentials for the remaining work. If access changed while paused, the run should surface that state instead of inheriting stale authority.

Do scoped credentials prevent prompt injection from causing damage?

They limit the damage that a successful prompt injection can cause, but they do not prevent the injection or validate the requested action. The agent may still misuse every permission it holds. Combine narrow credentials with tool-call validation, approval policy, sandboxing, and observable execution.

Related glossary terms.

Scoped credentials