@1claw/openapi-spec 0.20.0 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,21 +40,22 @@ openapi-generator generate \
40
40
  import spec from "@1claw/openapi-spec/openapi.json";
41
41
  ```
42
42
 
43
- ## What's in the spec (v0.19.x)
43
+ ## What's in the spec (v0.20.x — API `info.version` 2.10.x)
44
44
 
45
- - **Auth agent JWT** — `POST /v1/auth/agent-token` documents optional JWT claim **`shroud_config`** when the agent has Shroud enabled (mirrors DB; consumed by Shroud PolicyEngine on LLM requests). Re-exchange after changing agent Shroud settings.
45
+ - **OIDC Federation (1claw as IdP)** — `GET /.well-known/openid-configuration` (public discovery: issuer, jwks_uri, supported algs `["EdDSA","RS256"]`, supported grant types incl. token-exchange), `GET /.well-known/jwks.json` (public JWKS — every active EdDSA + RS256 key version, keyed by deterministic `kid`), `POST /v1/auth/federated-token` (RFC 8693 token exchange accepts JSON or `application/x-www-form-urlencoded`; subject token is an agent JWT or `ocv_` API key; returns RS256 JWT scoped to `audience`). Agent fields: `federation_enabled`, `federation_audiences[]`, `federated_token_ttl_seconds`. Designed for Anthropic Workload Identity Federation, GCP STS, AWS STS, etc.
46
+ - **Auth — agent JWT** — `POST /v1/auth/agent-token` documents optional JWT claim **`shroud_config`** when the agent has Shroud enabled (mirrors DB; consumed by Shroud PolicyEngine on LLM requests). Re-exchange after changing agent Shroud settings. Federation tokens use a separate KMS RSA-2048 key and are signed RS256.
46
47
  - **Auth — password reset** — `POST /v1/auth/forgot-password`, `POST /v1/auth/reset-password` (public; anti-enumeration on forgot)
47
48
  - **Billing — LLM token billing** — `GET /v1/billing/llm-token-billing` (`LlmTokenBillingStatus`: `enabled`, `subscription_status`, optional `credit_balance`, optional `billing_cycle_usage` with `metered_lines[]`), `POST .../subscribe`, `POST .../disable` (Stripe AI Gateway add-on; optional org feature)
48
49
  - **Treasury** — Safe multisig treasuries: `POST/GET /v1/treasury`, `GET/PATCH/DELETE /v1/treasury/{id}`, signers, agent access requests (`requests[]` on list)
49
50
  - **Vaults** — CRUD, CMEK enable/disable, key rotation with job tracking, MPC enable/disable (`POST /v1/vaults/{id}/mpc`, `DELETE /v1/vaults/{id}/mpc`)
50
51
  - **Secrets** — CRUD, versioning, CMEK-encrypted flag, `client_share` in responses (MPC vaults)
51
- - **Agents** — CRUD with `auth_method` (api_key, mtls, oidc_client_credentials), auto-generated SSH keypairs, `token_ttl_seconds`, `vault_ids`, Intents API, transaction guardrails (`tx_to_allowlist`, `tx_max_value_eth`, `tx_daily_limit_eth`, `tx_allowed_chains`); **`GET /v1/agents/{id}`** includes **`tx_spent_today_eth`** (rolling UTC-day spend from recorded txs) for clients such as **Shroud** that enforce the daily cap alongside per-tx limits
52
+ - **Agents** — CRUD with `auth_method` (api_key, mtls, oidc_client_credentials), auto-generated SSH keypairs, `token_ttl_seconds`, `vault_ids`, Intents API, transaction guardrails (`tx_to_allowlist`, `tx_max_value_eth`, `tx_daily_limit_eth`, `tx_allowed_chains`), **OIDC federation knobs** (`federation_enabled`, `federation_audiences`, `federated_token_ttl_seconds`); **`GET /v1/agents/{id}`** includes **`tx_spent_today_eth`** (rolling UTC-day spend from recorded txs) for clients such as **Shroud** that enforce the daily cap alongside per-tx limits
52
53
  - **Policies** — Glob-based access control
53
54
  - **Sharing** — Links, user/agent shares, accept/decline
54
55
  - **Billing** — Subscriptions, credits, x402, LLM token billing (see above)
55
56
  - **Audit** — Hash-chained event log
56
57
  - **Chains** — Supported blockchain registry
57
- - **Auth** — JWT, API keys, agent tokens, MFA, device flow, Google OAuth
58
+ - **Auth** — JWT, API keys, agent tokens, MFA, device flow, Google OAuth, **federated tokens (RFC 8693)**
58
59
  - **Org** — List members, invite, update/remove member; `GET /v1/org/agent-keys-vault` (users only, returns __agent-keys vault id or 404)
59
60
 
60
61
  ## Included files
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "1Claw API",
5
- "version": "2.10.0",
5
+ "version": "2.10.1",
6
6
  "description": "Secure secret management for AI agents. Provides vaults, secrets,\npolicy-based access control, agent identity, Intents API,\nsharing, billing, and audit logging.\n\nAll endpoints require JWT Bearer authentication unless marked with\n`security: []`.\n",
7
7
  "contact": {
8
8
  "email": "ops@1claw.xyz"
@@ -267,7 +267,7 @@
267
267
  "Authentication"
268
268
  ],
269
269
  "summary": "Get JWT verification public key",
270
- "description": "Returns the Ed25519 public key used to sign JWTs.\nUse this to verify tokens independently (e.g. in a TEE proxy or\ngateway). No authentication required.\n",
270
+ "description": "Returns the Ed25519 public key used to sign JWTs.\nUse this to verify tokens independently (e.g. in a TEE proxy or\ngateway). No authentication required.\n\nFor OIDC-compliant relying parties (Anthropic Workload Identity\nFederation, etc.) prefer the JWKS endpoint at\n`/.well-known/jwks.json` together with the discovery document\nat `/.well-known/openid-configuration` — those advertise both\nEd25519 and RS256 keys keyed by `kid` and survive key rotation.\n",
271
271
  "operationId": "getJwtPublicKey",
272
272
  "security": [],
273
273
  "responses": {
@@ -298,6 +298,110 @@
298
298
  }
299
299
  }
300
300
  },
301
+ "/v1/auth/federated-token": {
302
+ "post": {
303
+ "tags": [
304
+ "Authentication"
305
+ ],
306
+ "summary": "Exchange a 1claw token for an OIDC federation token (RFC 8693)",
307
+ "description": "Mints a short-lived RS256-signed JWT targeted at an external\nrelying party (e.g. Anthropic Workload Identity Federation).\nThe relying party validates the token via this issuer's JWKS\nURL (`/.well-known/jwks.json`) and exchanges it for its own\nshort-lived service credentials.\n\nRequirements:\n- The agent that owns the `subject_token` must have\n `federation_enabled = true` and the requested `audience`\n must appear in `federation_audiences`.\n- The `subject_token` must be a valid 1claw agent JWT or\n `ocv_` API key.\n- Optional `scope` narrows the agent's existing scopes — it\n cannot escalate.\n\nReturns 503 when `ONECLAW_JWT_RS256_SIGNING_KEY_ID` is not\nconfigured on the server.\n",
308
+ "operationId": "exchangeFederatedToken",
309
+ "security": [],
310
+ "requestBody": {
311
+ "required": true,
312
+ "content": {
313
+ "application/json": {
314
+ "schema": {
315
+ "$ref": "#/components/schemas/TokenExchangeRequest"
316
+ }
317
+ },
318
+ "application/x-www-form-urlencoded": {
319
+ "schema": {
320
+ "$ref": "#/components/schemas/TokenExchangeRequest"
321
+ }
322
+ }
323
+ }
324
+ },
325
+ "responses": {
326
+ "200": {
327
+ "description": "Federation token issued",
328
+ "content": {
329
+ "application/json": {
330
+ "schema": {
331
+ "$ref": "#/components/schemas/TokenExchangeResponse"
332
+ }
333
+ }
334
+ }
335
+ },
336
+ "400": {
337
+ "$ref": "#/components/responses/BadRequest"
338
+ },
339
+ "401": {
340
+ "$ref": "#/components/responses/Unauthorized"
341
+ },
342
+ "403": {
343
+ "$ref": "#/components/responses/Forbidden"
344
+ },
345
+ "503": {
346
+ "description": "RS256 signing key not configured"
347
+ }
348
+ }
349
+ }
350
+ },
351
+ "/.well-known/openid-configuration": {
352
+ "get": {
353
+ "tags": [
354
+ "Authentication"
355
+ ],
356
+ "summary": "OIDC discovery document",
357
+ "description": "Standard OpenID Connect discovery document advertising the\nissuer URL, JWKS URL, supported algorithms (`EdDSA`, `RS256`),\nand the RFC 8693 token-exchange endpoint. External IdPs\n(Anthropic WIF, Okta, Auth0, etc.) read this URL to learn\nwhere 1claw publishes its JWKS.\n",
358
+ "operationId": "openidConfiguration",
359
+ "security": [],
360
+ "responses": {
361
+ "200": {
362
+ "description": "Discovery document",
363
+ "content": {
364
+ "application/json": {
365
+ "schema": {
366
+ "type": "object"
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ }
373
+ },
374
+ "/.well-known/jwks.json": {
375
+ "get": {
376
+ "tags": [
377
+ "Authentication"
378
+ ],
379
+ "summary": "JSON Web Key Set",
380
+ "description": "Public keys for every active version of every JWT signing\nkey (Ed25519 + RSA-2048). Each entry includes a `kid` so\nconsumers can validate tokens issued before the most recent\nkey rotation. Cached for 5 minutes via `Cache-Control` and\nCORS-permissive for browser-based IdP consoles.\n",
381
+ "operationId": "jwks",
382
+ "security": [],
383
+ "responses": {
384
+ "200": {
385
+ "description": "JWK Set",
386
+ "content": {
387
+ "application/jwk-set+json": {
388
+ "schema": {
389
+ "type": "object",
390
+ "properties": {
391
+ "keys": {
392
+ "type": "array",
393
+ "items": {
394
+ "type": "object"
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ }
402
+ }
403
+ }
404
+ },
301
405
  "/v1/auth/signup": {
302
406
  "post": {
303
407
  "tags": [
@@ -1708,7 +1812,7 @@
1708
1812
  }
1709
1813
  }
1710
1814
  },
1711
- "/v1/vaults/{vault_id}/secret-version/{path}/{version}/disable": {
1815
+ "/v1/vaults/{vault_id}/secret-version-disable/{path}/{version}": {
1712
1816
  "post": {
1713
1817
  "tags": [
1714
1818
  "Secrets"
@@ -1922,7 +2026,7 @@
1922
2026
  ],
1923
2027
  "summary": "Self-enroll an agent",
1924
2028
  "operationId": "enrollAgent",
1925
- "description": "Public endpoint (no auth required). Creates an agent under the human's org\nand emails the credentials to the specified human email. The API key is NOT\nreturned in the response. Anti-spam: IP rate limiting + per-email cooldown.\n",
2029
+ "description": "Public endpoint (no auth required).\n\n**With `human_email`:** Creates a pending enrollment for that account's org,\nemails Allow/Deny links, and returns `approval_url` in the JSON body (use if email\nis delayed). The API key is NOT returned until the human approves.\n\n**Name only (omit `human_email`):** Creates a link-only pending enrollment.\nThe response includes `approval_url`; the human opens it while signed in to\napprove the agent into their org.\n\nAnti-spam: IP rate limiting, per-email cooldown, caps on pending rows.\n",
1926
2030
  "requestBody": {
1927
2031
  "required": true,
1928
2032
  "content": {
@@ -4868,6 +4972,76 @@
4868
4972
  }
4869
4973
  }
4870
4974
  },
4975
+ "TokenExchangeRequest": {
4976
+ "type": "object",
4977
+ "required": [
4978
+ "grant_type",
4979
+ "subject_token",
4980
+ "subject_token_type",
4981
+ "audience"
4982
+ ],
4983
+ "description": "RFC 8693 token-exchange request body. `subject_token_type`\naccepts the standard JWT URI or 1claw's API-key URI:\n - `urn:ietf:params:oauth:token-type:jwt`\n - `urn:1claw:params:oauth:token-type:api-key`\n",
4984
+ "properties": {
4985
+ "grant_type": {
4986
+ "type": "string",
4987
+ "enum": [
4988
+ "urn:ietf:params:oauth:grant-type:token-exchange"
4989
+ ]
4990
+ },
4991
+ "subject_token": {
4992
+ "type": "string",
4993
+ "description": "1claw JWT or `ocv_` API key authorising the exchange."
4994
+ },
4995
+ "subject_token_type": {
4996
+ "type": "string",
4997
+ "enum": [
4998
+ "urn:ietf:params:oauth:token-type:jwt",
4999
+ "urn:1claw:params:oauth:token-type:api-key"
5000
+ ]
5001
+ },
5002
+ "audience": {
5003
+ "type": "string",
5004
+ "format": "uri",
5005
+ "description": "Required `aud` claim for the issued federation token (must be in agent's allowlist).",
5006
+ "example": "https://api.anthropic.com"
5007
+ },
5008
+ "scope": {
5009
+ "type": "string",
5010
+ "description": "Optional space-separated subset of the agent's existing scopes."
5011
+ },
5012
+ "requested_token_type": {
5013
+ "type": "string",
5014
+ "description": "Optional. Defaults to `urn:ietf:params:oauth:token-type:jwt`."
5015
+ }
5016
+ }
5017
+ },
5018
+ "TokenExchangeResponse": {
5019
+ "type": "object",
5020
+ "required": [
5021
+ "access_token",
5022
+ "issued_token_type",
5023
+ "token_type",
5024
+ "expires_in"
5025
+ ],
5026
+ "properties": {
5027
+ "access_token": {
5028
+ "type": "string",
5029
+ "description": "RS256-signed federation JWT."
5030
+ },
5031
+ "issued_token_type": {
5032
+ "type": "string"
5033
+ },
5034
+ "token_type": {
5035
+ "type": "string"
5036
+ },
5037
+ "expires_in": {
5038
+ "type": "integer"
5039
+ },
5040
+ "scope": {
5041
+ "type": "string"
5042
+ }
5043
+ }
5044
+ },
4871
5045
  "SignupRequest": {
4872
5046
  "type": "object",
4873
5047
  "required": [
@@ -5766,8 +5940,7 @@
5766
5940
  "EnrollAgentRequest": {
5767
5941
  "type": "object",
5768
5942
  "required": [
5769
- "name",
5770
- "human_email"
5943
+ "name"
5771
5944
  ],
5772
5945
  "properties": {
5773
5946
  "name": {
@@ -5777,7 +5950,7 @@
5777
5950
  "human_email": {
5778
5951
  "type": "string",
5779
5952
  "format": "email",
5780
- "description": "Email of the human who will receive the agent credentials"
5953
+ "description": "Optional. If set, pending enrollment is bound to that 1Claw account email\nand Allow/Deny links are emailed. If omitted, only `approval_url` is used\n(link-only enrollment; human must open the URL while signed in).\n"
5781
5954
  },
5782
5955
  "description": {
5783
5956
  "type": "string",
@@ -5791,11 +5964,16 @@
5791
5964
  "agent_id": {
5792
5965
  "type": "string",
5793
5966
  "format": "uuid",
5794
- "description": "UUID of the created agent (nil UUID when email not found — uniform response)"
5967
+ "description": "UUID of the created agent (nil UUID until approved — uniform response)"
5795
5968
  },
5796
5969
  "message": {
5797
5970
  "type": "string",
5798
- "description": "Status message (always generic to prevent email enumeration)"
5971
+ "description": "Status message (worded to limit email enumeration where applicable)"
5972
+ },
5973
+ "approval_url": {
5974
+ "type": "string",
5975
+ "format": "uri",
5976
+ "description": "Present when a pending enrollment was created and the client should show\nthis link (email flow includes it as a fallback; name-only flow requires it).\n"
5799
5977
  }
5800
5978
  }
5801
5979
  },
@@ -5945,6 +6123,25 @@
5945
6123
  },
5946
6124
  "shroud_config": {
5947
6125
  "$ref": "#/components/schemas/ShroudConfig"
6126
+ },
6127
+ "federation_enabled": {
6128
+ "type": "boolean",
6129
+ "description": "Enable OIDC federation (RFC 8693 token-exchange) for this agent.\nWhen true, the agent may call POST /v1/auth/federated-token to mint\nfederation tokens for the audiences listed in `federation_audiences`.\n"
6130
+ },
6131
+ "federation_audiences": {
6132
+ "type": "array",
6133
+ "items": {
6134
+ "type": "string",
6135
+ "format": "uri"
6136
+ },
6137
+ "description": "Allowlist of `aud` values the federation token-exchange may issue\ntokens for (e.g. `[\"https://api.anthropic.com\"]`). Empty array\nblocks all federation requests (zero-trust default).\n"
6138
+ },
6139
+ "federated_token_ttl_seconds": {
6140
+ "type": "integer",
6141
+ "minimum": 60,
6142
+ "maximum": 3600,
6143
+ "nullable": true,
6144
+ "description": "Per-agent TTL override for federation tokens (seconds). NULL falls\nback to the global default (`ONECLAW_JWT_FEDERATED_TOKEN_EXPIRY_SECS`).\nHard-capped at 3600 seconds.\n"
5948
6145
  }
5949
6146
  }
5950
6147
  },
@@ -6050,6 +6247,23 @@
6050
6247
  "shroud_config": {
6051
6248
  "$ref": "#/components/schemas/ShroudConfig"
6052
6249
  },
6250
+ "federation_enabled": {
6251
+ "type": "boolean",
6252
+ "description": "Whether this agent may mint OIDC federation tokens via\nPOST /v1/auth/federated-token. False by default.\n"
6253
+ },
6254
+ "federation_audiences": {
6255
+ "type": "array",
6256
+ "items": {
6257
+ "type": "string",
6258
+ "format": "uri"
6259
+ },
6260
+ "description": "Allowlist of audience URIs the agent may federate to."
6261
+ },
6262
+ "federated_token_ttl_seconds": {
6263
+ "type": "integer",
6264
+ "nullable": true,
6265
+ "description": "Per-agent TTL override for federation tokens (60..=3600)."
6266
+ },
6053
6267
  "created_at": {
6054
6268
  "type": "string",
6055
6269
  "format": "date-time"
@@ -8446,6 +8660,36 @@
8446
8660
  "type": "string"
8447
8661
  }
8448
8662
  },
8663
+ "response_injection_score": {
8664
+ "type": "number",
8665
+ "description": "Response-side prompt-injection score (0.0–1.0)."
8666
+ },
8667
+ "response_context_injection_score": {
8668
+ "type": "number",
8669
+ "description": "Response-side context-injection score (0.0–1.0)."
8670
+ },
8671
+ "response_injection_categories": {
8672
+ "type": "array",
8673
+ "items": {
8674
+ "type": "string"
8675
+ },
8676
+ "description": "Category tags emitted by the response-side filters (e.g. `markdown_image_exfil`, `data_uri_blob`, `echoed_instruction`)."
8677
+ },
8678
+ "external_urls_flagged": {
8679
+ "type": "array",
8680
+ "items": {
8681
+ "type": "string"
8682
+ },
8683
+ "description": "URLs emitted by the model that were flagged as potential exfil / callback targets."
8684
+ },
8685
+ "unexpected_code_blocks": {
8686
+ "type": "integer",
8687
+ "description": "Number of code fences in the response that were not expected for the agent's allowed task set."
8688
+ },
8689
+ "content_filtered": {
8690
+ "type": "boolean",
8691
+ "description": "True when Shroud rewrote or blocked response content before returning it to the agent."
8692
+ },
8449
8693
  "metadata": {
8450
8694
  "type": "object"
8451
8695
  },
@@ -8505,6 +8749,34 @@
8505
8749
  },
8506
8750
  "metadata": {
8507
8751
  "type": "object"
8752
+ },
8753
+ "response_injection_score": {
8754
+ "type": "number",
8755
+ "default": 0
8756
+ },
8757
+ "response_context_injection_score": {
8758
+ "type": "number",
8759
+ "default": 0
8760
+ },
8761
+ "response_injection_categories": {
8762
+ "type": "array",
8763
+ "items": {
8764
+ "type": "string"
8765
+ }
8766
+ },
8767
+ "external_urls_flagged": {
8768
+ "type": "array",
8769
+ "items": {
8770
+ "type": "string"
8771
+ }
8772
+ },
8773
+ "unexpected_code_blocks": {
8774
+ "type": "integer",
8775
+ "default": 0
8776
+ },
8777
+ "content_filtered": {
8778
+ "type": "boolean",
8779
+ "default": false
8508
8780
  }
8509
8781
  }
8510
8782
  },
package/openapi.yaml CHANGED
@@ -2,7 +2,7 @@ openapi: 3.1.0
2
2
 
3
3
  info:
4
4
  title: 1Claw API
5
- version: 2.10.0
5
+ version: 2.10.1
6
6
  description: |
7
7
  Secure secret management for AI agents. Provides vaults, secrets,
8
8
  policy-based access control, agent identity, Intents API,
@@ -192,6 +192,12 @@ paths:
192
192
  Returns the Ed25519 public key used to sign JWTs.
193
193
  Use this to verify tokens independently (e.g. in a TEE proxy or
194
194
  gateway). No authentication required.
195
+
196
+ For OIDC-compliant relying parties (Anthropic Workload Identity
197
+ Federation, etc.) prefer the JWKS endpoint at
198
+ `/.well-known/jwks.json` together with the discovery document
199
+ at `/.well-known/openid-configuration` — those advertise both
200
+ Ed25519 and RS256 keys keyed by `kid` and survive key rotation.
195
201
  operationId: getJwtPublicKey
196
202
  security: []
197
203
  responses:
@@ -210,6 +216,100 @@ paths:
210
216
  type: string
211
217
  description: Base64-encoded Ed25519 public key
212
218
 
219
+ /v1/auth/federated-token:
220
+ post:
221
+ tags: [Authentication]
222
+ summary: Exchange a 1claw token for an OIDC federation token (RFC 8693)
223
+ description: |
224
+ Mints a short-lived RS256-signed JWT targeted at an external
225
+ relying party (e.g. Anthropic Workload Identity Federation).
226
+ The relying party validates the token via this issuer's JWKS
227
+ URL (`/.well-known/jwks.json`) and exchanges it for its own
228
+ short-lived service credentials.
229
+
230
+ Requirements:
231
+ - The agent that owns the `subject_token` must have
232
+ `federation_enabled = true` and the requested `audience`
233
+ must appear in `federation_audiences`.
234
+ - The `subject_token` must be a valid 1claw agent JWT or
235
+ `ocv_` API key.
236
+ - Optional `scope` narrows the agent's existing scopes — it
237
+ cannot escalate.
238
+
239
+ Returns 503 when `ONECLAW_JWT_RS256_SIGNING_KEY_ID` is not
240
+ configured on the server.
241
+ operationId: exchangeFederatedToken
242
+ security: []
243
+ requestBody:
244
+ required: true
245
+ content:
246
+ application/json:
247
+ schema:
248
+ $ref: "#/components/schemas/TokenExchangeRequest"
249
+ application/x-www-form-urlencoded:
250
+ schema:
251
+ $ref: "#/components/schemas/TokenExchangeRequest"
252
+ responses:
253
+ "200":
254
+ description: Federation token issued
255
+ content:
256
+ application/json:
257
+ schema:
258
+ $ref: "#/components/schemas/TokenExchangeResponse"
259
+ "400":
260
+ $ref: "#/components/responses/BadRequest"
261
+ "401":
262
+ $ref: "#/components/responses/Unauthorized"
263
+ "403":
264
+ $ref: "#/components/responses/Forbidden"
265
+ "503":
266
+ description: RS256 signing key not configured
267
+
268
+ /.well-known/openid-configuration:
269
+ get:
270
+ tags: [Authentication]
271
+ summary: OIDC discovery document
272
+ description: |
273
+ Standard OpenID Connect discovery document advertising the
274
+ issuer URL, JWKS URL, supported algorithms (`EdDSA`, `RS256`),
275
+ and the RFC 8693 token-exchange endpoint. External IdPs
276
+ (Anthropic WIF, Okta, Auth0, etc.) read this URL to learn
277
+ where 1claw publishes its JWKS.
278
+ operationId: openidConfiguration
279
+ security: []
280
+ responses:
281
+ "200":
282
+ description: Discovery document
283
+ content:
284
+ application/json:
285
+ schema:
286
+ type: object
287
+
288
+ /.well-known/jwks.json:
289
+ get:
290
+ tags: [Authentication]
291
+ summary: JSON Web Key Set
292
+ description: |
293
+ Public keys for every active version of every JWT signing
294
+ key (Ed25519 + RSA-2048). Each entry includes a `kid` so
295
+ consumers can validate tokens issued before the most recent
296
+ key rotation. Cached for 5 minutes via `Cache-Control` and
297
+ CORS-permissive for browser-based IdP consoles.
298
+ operationId: jwks
299
+ security: []
300
+ responses:
301
+ "200":
302
+ description: JWK Set
303
+ content:
304
+ application/jwk-set+json:
305
+ schema:
306
+ type: object
307
+ properties:
308
+ keys:
309
+ type: array
310
+ items:
311
+ type: object
312
+
213
313
  /v1/auth/signup:
214
314
  post:
215
315
  tags: [Authentication]
@@ -1121,7 +1221,7 @@ paths:
1121
1221
  "410":
1122
1222
  description: Version has been disabled or expired
1123
1223
 
1124
- /v1/vaults/{vault_id}/secret-version/{path}/{version}/disable:
1224
+ /v1/vaults/{vault_id}/secret-version-disable/{path}/{version}:
1125
1225
  post:
1126
1226
  tags: [Secrets]
1127
1227
  summary: Disable a specific secret version
@@ -1258,9 +1358,17 @@ paths:
1258
1358
  summary: Self-enroll an agent
1259
1359
  operationId: enrollAgent
1260
1360
  description: |
1261
- Public endpoint (no auth required). Creates an agent under the human's org
1262
- and emails the credentials to the specified human email. The API key is NOT
1263
- returned in the response. Anti-spam: IP rate limiting + per-email cooldown.
1361
+ Public endpoint (no auth required).
1362
+
1363
+ **With `human_email`:** Creates a pending enrollment for that account's org,
1364
+ emails Allow/Deny links, and returns `approval_url` in the JSON body (use if email
1365
+ is delayed). The API key is NOT returned until the human approves.
1366
+
1367
+ **Name only (omit `human_email`):** Creates a link-only pending enrollment.
1368
+ The response includes `approval_url`; the human opens it while signed in to
1369
+ approve the agent into their org.
1370
+
1371
+ Anti-spam: IP rate limiting, per-email cooldown, caps on pending rows.
1264
1372
  requestBody:
1265
1373
  required: true
1266
1374
  content:
@@ -3168,6 +3276,55 @@ components:
3168
3276
  api_key:
3169
3277
  type: string
3170
3278
 
3279
+ TokenExchangeRequest:
3280
+ type: object
3281
+ required: [grant_type, subject_token, subject_token_type, audience]
3282
+ description: |
3283
+ RFC 8693 token-exchange request body. `subject_token_type`
3284
+ accepts the standard JWT URI or 1claw's API-key URI:
3285
+ - `urn:ietf:params:oauth:token-type:jwt`
3286
+ - `urn:1claw:params:oauth:token-type:api-key`
3287
+ properties:
3288
+ grant_type:
3289
+ type: string
3290
+ enum:
3291
+ - "urn:ietf:params:oauth:grant-type:token-exchange"
3292
+ subject_token:
3293
+ type: string
3294
+ description: 1claw JWT or `ocv_` API key authorising the exchange.
3295
+ subject_token_type:
3296
+ type: string
3297
+ enum:
3298
+ - "urn:ietf:params:oauth:token-type:jwt"
3299
+ - "urn:1claw:params:oauth:token-type:api-key"
3300
+ audience:
3301
+ type: string
3302
+ format: uri
3303
+ description: Required `aud` claim for the issued federation token (must be in agent's allowlist).
3304
+ example: "https://api.anthropic.com"
3305
+ scope:
3306
+ type: string
3307
+ description: Optional space-separated subset of the agent's existing scopes.
3308
+ requested_token_type:
3309
+ type: string
3310
+ description: Optional. Defaults to `urn:ietf:params:oauth:token-type:jwt`.
3311
+
3312
+ TokenExchangeResponse:
3313
+ type: object
3314
+ required: [access_token, issued_token_type, token_type, expires_in]
3315
+ properties:
3316
+ access_token:
3317
+ type: string
3318
+ description: RS256-signed federation JWT.
3319
+ issued_token_type:
3320
+ type: string
3321
+ token_type:
3322
+ type: string
3323
+ expires_in:
3324
+ type: integer
3325
+ scope:
3326
+ type: string
3327
+
3171
3328
  SignupRequest:
3172
3329
  type: object
3173
3330
  required: [email, password]
@@ -3792,7 +3949,7 @@ components:
3792
3949
 
3793
3950
  EnrollAgentRequest:
3794
3951
  type: object
3795
- required: [name, human_email]
3952
+ required: [name]
3796
3953
  properties:
3797
3954
  name:
3798
3955
  type: string
@@ -3800,7 +3957,10 @@ components:
3800
3957
  human_email:
3801
3958
  type: string
3802
3959
  format: email
3803
- description: Email of the human who will receive the agent credentials
3960
+ description: |
3961
+ Optional. If set, pending enrollment is bound to that 1Claw account email
3962
+ and Allow/Deny links are emailed. If omitted, only `approval_url` is used
3963
+ (link-only enrollment; human must open the URL while signed in).
3804
3964
  description:
3805
3965
  type: string
3806
3966
  description: Optional agent description
@@ -3811,10 +3971,16 @@ components:
3811
3971
  agent_id:
3812
3972
  type: string
3813
3973
  format: uuid
3814
- description: UUID of the created agent (nil UUID when email not found — uniform response)
3974
+ description: UUID of the created agent (nil UUID until approved — uniform response)
3815
3975
  message:
3816
3976
  type: string
3817
- description: Status message (always generic to prevent email enumeration)
3977
+ description: Status message (worded to limit email enumeration where applicable)
3978
+ approval_url:
3979
+ type: string
3980
+ format: uri
3981
+ description: |
3982
+ Present when a pending enrollment was created and the client should show
3983
+ this link (email flow includes it as a fallback; name-only flow requires it).
3818
3984
 
3819
3985
  # --- Agents ---
3820
3986
 
@@ -3920,6 +4086,30 @@ components:
3920
4086
  description: Enable/disable Shroud LLM Proxy
3921
4087
  shroud_config:
3922
4088
  $ref: "#/components/schemas/ShroudConfig"
4089
+ federation_enabled:
4090
+ type: boolean
4091
+ description: |
4092
+ Enable OIDC federation (RFC 8693 token-exchange) for this agent.
4093
+ When true, the agent may call POST /v1/auth/federated-token to mint
4094
+ federation tokens for the audiences listed in `federation_audiences`.
4095
+ federation_audiences:
4096
+ type: array
4097
+ items:
4098
+ type: string
4099
+ format: uri
4100
+ description: |
4101
+ Allowlist of `aud` values the federation token-exchange may issue
4102
+ tokens for (e.g. `["https://api.anthropic.com"]`). Empty array
4103
+ blocks all federation requests (zero-trust default).
4104
+ federated_token_ttl_seconds:
4105
+ type: integer
4106
+ minimum: 60
4107
+ maximum: 3600
4108
+ nullable: true
4109
+ description: |
4110
+ Per-agent TTL override for federation tokens (seconds). NULL falls
4111
+ back to the global default (`ONECLAW_JWT_FEDERATED_TOKEN_EXPIRY_SECS`).
4112
+ Hard-capped at 3600 seconds.
3923
4113
 
3924
4114
  AgentResponse:
3925
4115
  type: object
@@ -3995,6 +4185,21 @@ components:
3995
4185
  description: Whether this agent routes LLM traffic through the Shroud TEE proxy
3996
4186
  shroud_config:
3997
4187
  $ref: "#/components/schemas/ShroudConfig"
4188
+ federation_enabled:
4189
+ type: boolean
4190
+ description: |
4191
+ Whether this agent may mint OIDC federation tokens via
4192
+ POST /v1/auth/federated-token. False by default.
4193
+ federation_audiences:
4194
+ type: array
4195
+ items:
4196
+ type: string
4197
+ format: uri
4198
+ description: Allowlist of audience URIs the agent may federate to.
4199
+ federated_token_ttl_seconds:
4200
+ type: integer
4201
+ nullable: true
4202
+ description: Per-agent TTL override for federation tokens (60..=3600).
3998
4203
  created_at:
3999
4204
  type: string
4000
4205
  format: date-time
@@ -5643,6 +5848,31 @@ components:
5643
5848
  type: array
5644
5849
  items:
5645
5850
  type: string
5851
+ # Response-side inspection signals (Shroud v0.5.0+,
5852
+ # H-RESP-INSPECT). Optional — pre-v0.5.0 events have them
5853
+ # unset; treat as zero / empty.
5854
+ response_injection_score:
5855
+ type: number
5856
+ description: Response-side prompt-injection score (0.0–1.0).
5857
+ response_context_injection_score:
5858
+ type: number
5859
+ description: Response-side context-injection score (0.0–1.0).
5860
+ response_injection_categories:
5861
+ type: array
5862
+ items:
5863
+ type: string
5864
+ description: Category tags emitted by the response-side filters (e.g. `markdown_image_exfil`, `data_uri_blob`, `echoed_instruction`).
5865
+ external_urls_flagged:
5866
+ type: array
5867
+ items:
5868
+ type: string
5869
+ description: URLs emitted by the model that were flagged as potential exfil / callback targets.
5870
+ unexpected_code_blocks:
5871
+ type: integer
5872
+ description: Number of code fences in the response that were not expected for the agent's allowed task set.
5873
+ content_filtered:
5874
+ type: boolean
5875
+ description: True when Shroud rewrote or blocked response content before returning it to the agent.
5646
5876
  metadata:
5647
5877
  type: object
5648
5878
  timestamp:
@@ -5684,6 +5914,28 @@ components:
5684
5914
  type: string
5685
5915
  metadata:
5686
5916
  type: object
5917
+ # Response-side inspection signals (Shroud v0.5.0+,
5918
+ # H-RESP-INSPECT). Optional for backward compatibility.
5919
+ response_injection_score:
5920
+ type: number
5921
+ default: 0
5922
+ response_context_injection_score:
5923
+ type: number
5924
+ default: 0
5925
+ response_injection_categories:
5926
+ type: array
5927
+ items:
5928
+ type: string
5929
+ external_urls_flagged:
5930
+ type: array
5931
+ items:
5932
+ type: string
5933
+ unexpected_code_blocks:
5934
+ type: integer
5935
+ default: 0
5936
+ content_filtered:
5937
+ type: boolean
5938
+ default: false
5687
5939
 
5688
5940
  ShroudThreatSummary:
5689
5941
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1claw/openapi-spec",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
4
4
  "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API — generate clients in any language",
5
5
  "license": "MIT",
6
6
  "repository": {