|
| 1 | +--- |
| 2 | +title: "Provisioned credentials" |
| 3 | +sdk: python |
| 4 | +spec_sections: ["§9.7", "§9.8", "§14"] |
| 5 | +order: 11 |
| 6 | +kind: feature |
| 7 | +--- |
| 8 | + |
| 9 | +## What it is |
| 10 | + |
| 11 | +`model.use` constrains which upstream model identifiers a job may |
| 12 | +use. When a runtime is configured with a credential provisioner, it |
| 13 | +can mint short-lived credentials scoped to the job's `cost.budget`, |
| 14 | +`model.use`, and `lease_constraints.expires_at`, then attach them to |
| 15 | +`job.accepted.payload.credentials`. |
| 16 | + |
| 17 | +Credentials are issued only for the submitting session and are |
| 18 | +revoked when the job reaches any terminal state. List and subscribe |
| 19 | +surfaces intentionally omit credential values. |
| 20 | + |
| 21 | +## Feature flags |
| 22 | + |
| 23 | +- `model.use` |
| 24 | +- `provisioned_credentials` |
| 25 | + |
| 26 | +The runtime advertises these flags only when `credential_provisioner` |
| 27 | +and `revocation_log` are configured. |
| 28 | + |
| 29 | +## Python API |
| 30 | + |
| 31 | +```python |
| 32 | +runtime = ARCPRuntime( |
| 33 | + runtime=RuntimeInfo(name="demo", version="1.1.0"), |
| 34 | + bearer=StaticBearerVerifier({"demo-token": "p1"}), |
| 35 | + credential_provisioner=InMemoryCredentialProvisioner(), |
| 36 | + revocation_log=InMemoryRevocationLog(), |
| 37 | +) |
| 38 | + |
| 39 | +handle = await client.submit( |
| 40 | + agent="summarize", |
| 41 | + lease_request={ |
| 42 | + "model.use": ["tier-fast/*"], |
| 43 | + "cost.budget": ["USD:5.00"], |
| 44 | + }, |
| 45 | +) |
| 46 | + |
| 47 | +credential = handle.credentials[0] |
| 48 | +``` |
| 49 | + |
| 50 | +Inside an agent, call `ctx.authorize_model("tier-fast/mini")` before |
| 51 | +using a model id when the runtime is in the call path. Provisioner |
| 52 | +adapters can translate upstream budget failures by raising |
| 53 | +`UpstreamBudgetExhausted`; the runtime emits `BUDGET_EXHAUSTED`. |
| 54 | + |
| 55 | +## See also |
| 56 | + |
| 57 | +- Example: [`../04-examples/provisioned-credentials.md`](../04-examples/provisioned-credentials.md). |
| 58 | +- Spec: [`../../../spec/docs/draft-arcp-1.1.md`](../../../spec/docs/draft-arcp-1.1.md) §§9.7–9.8. |
0 commit comments