@1claw/sdk 0.20.2 → 0.21.0

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.
@@ -98,6 +98,12 @@ export interface paths {
98
98
  * @description Returns the Ed25519 public key used to sign JWTs.
99
99
  * Use this to verify tokens independently (e.g. in a TEE proxy or
100
100
  * gateway). No authentication required.
101
+ *
102
+ * For OIDC-compliant relying parties (Anthropic Workload Identity
103
+ * Federation, etc.) prefer the JWKS endpoint at
104
+ * `/.well-known/jwks.json` together with the discovery document
105
+ * at `/.well-known/openid-configuration` — those advertise both
106
+ * Ed25519 and RS256 keys keyed by `kid` and survive key rotation.
101
107
  */
102
108
  get: operations["getJwtPublicKey"];
103
109
  put?: never;
@@ -108,6 +114,90 @@ export interface paths {
108
114
  patch?: never;
109
115
  trace?: never;
110
116
  };
117
+ "/v1/auth/federated-token": {
118
+ parameters: {
119
+ query?: never;
120
+ header?: never;
121
+ path?: never;
122
+ cookie?: never;
123
+ };
124
+ get?: never;
125
+ put?: never;
126
+ /**
127
+ * Exchange a 1claw token for an OIDC federation token (RFC 8693)
128
+ * @description Mints a short-lived RS256-signed JWT targeted at an external
129
+ * relying party (e.g. Anthropic Workload Identity Federation).
130
+ * The relying party validates the token via this issuer's JWKS
131
+ * URL (`/.well-known/jwks.json`) and exchanges it for its own
132
+ * short-lived service credentials.
133
+ *
134
+ * Requirements:
135
+ * - The agent that owns the `subject_token` must have
136
+ * `federation_enabled = true` and the requested `audience`
137
+ * must appear in `federation_audiences`.
138
+ * - The `subject_token` must be a valid 1claw agent JWT or
139
+ * `ocv_` API key.
140
+ * - Optional `scope` narrows the agent's existing scopes — it
141
+ * cannot escalate.
142
+ *
143
+ * Returns 503 when `ONECLAW_JWT_RS256_SIGNING_KEY_ID` is not
144
+ * configured on the server.
145
+ */
146
+ post: operations["exchangeFederatedToken"];
147
+ delete?: never;
148
+ options?: never;
149
+ head?: never;
150
+ patch?: never;
151
+ trace?: never;
152
+ };
153
+ "/.well-known/openid-configuration": {
154
+ parameters: {
155
+ query?: never;
156
+ header?: never;
157
+ path?: never;
158
+ cookie?: never;
159
+ };
160
+ /**
161
+ * OIDC discovery document
162
+ * @description Standard OpenID Connect discovery document advertising the
163
+ * issuer URL, JWKS URL, supported algorithms (`EdDSA`, `RS256`),
164
+ * and the RFC 8693 token-exchange endpoint. External IdPs
165
+ * (Anthropic WIF, Okta, Auth0, etc.) read this URL to learn
166
+ * where 1claw publishes its JWKS.
167
+ */
168
+ get: operations["openidConfiguration"];
169
+ put?: never;
170
+ post?: never;
171
+ delete?: never;
172
+ options?: never;
173
+ head?: never;
174
+ patch?: never;
175
+ trace?: never;
176
+ };
177
+ "/.well-known/jwks.json": {
178
+ parameters: {
179
+ query?: never;
180
+ header?: never;
181
+ path?: never;
182
+ cookie?: never;
183
+ };
184
+ /**
185
+ * JSON Web Key Set
186
+ * @description Public keys for every active version of every JWT signing
187
+ * key (Ed25519 + RSA-2048). Each entry includes a `kid` so
188
+ * consumers can validate tokens issued before the most recent
189
+ * key rotation. Cached for 5 minutes via `Cache-Control` and
190
+ * CORS-permissive for browser-based IdP consoles.
191
+ */
192
+ get: operations["jwks"];
193
+ put?: never;
194
+ post?: never;
195
+ delete?: never;
196
+ options?: never;
197
+ head?: never;
198
+ patch?: never;
199
+ trace?: never;
200
+ };
111
201
  "/v1/auth/signup": {
112
202
  parameters: {
113
203
  query?: never;
@@ -977,6 +1067,75 @@ export interface paths {
977
1067
  patch?: never;
978
1068
  trace?: never;
979
1069
  };
1070
+ "/v1/agents/{agent_id}/signing-keys": {
1071
+ parameters: {
1072
+ query?: never;
1073
+ header?: never;
1074
+ path?: never;
1075
+ cookie?: never;
1076
+ };
1077
+ /** List signing keys for an agent */
1078
+ get: operations["listSigningKeys"];
1079
+ put?: never;
1080
+ /** Provision a signing key for a chain */
1081
+ post: operations["createSigningKey"];
1082
+ delete?: never;
1083
+ options?: never;
1084
+ head?: never;
1085
+ patch?: never;
1086
+ trace?: never;
1087
+ };
1088
+ "/v1/agents/{agent_id}/signing-keys/{chain}/rotate": {
1089
+ parameters: {
1090
+ query?: never;
1091
+ header?: never;
1092
+ path?: never;
1093
+ cookie?: never;
1094
+ };
1095
+ get?: never;
1096
+ put?: never;
1097
+ /** Rotate a signing key for a chain */
1098
+ post: operations["rotateSigningKey"];
1099
+ delete?: never;
1100
+ options?: never;
1101
+ head?: never;
1102
+ patch?: never;
1103
+ trace?: never;
1104
+ };
1105
+ "/v1/agents/{agent_id}/signing-keys/{chain}": {
1106
+ parameters: {
1107
+ query?: never;
1108
+ header?: never;
1109
+ path?: never;
1110
+ cookie?: never;
1111
+ };
1112
+ get?: never;
1113
+ put?: never;
1114
+ post?: never;
1115
+ /** Deactivate a signing key for a chain */
1116
+ delete: operations["deactivateSigningKey"];
1117
+ options?: never;
1118
+ head?: never;
1119
+ patch?: never;
1120
+ trace?: never;
1121
+ };
1122
+ "/v1/agents/{agent_id}/sign": {
1123
+ parameters: {
1124
+ query?: never;
1125
+ header?: never;
1126
+ path?: never;
1127
+ cookie?: never;
1128
+ };
1129
+ get?: never;
1130
+ put?: never;
1131
+ /** Unified signing intent (EIP-191, EIP-712, EIP-2718 types 0-4) */
1132
+ post: operations["signIntent"];
1133
+ delete?: never;
1134
+ options?: never;
1135
+ head?: never;
1136
+ patch?: never;
1137
+ trace?: never;
1138
+ };
980
1139
  "/v1/chains": {
981
1140
  parameters: {
982
1141
  query?: never;
@@ -2042,6 +2201,38 @@ export interface components {
2042
2201
  UserApiKeyTokenRequest: {
2043
2202
  api_key: string;
2044
2203
  };
2204
+ /**
2205
+ * @description RFC 8693 token-exchange request body. `subject_token_type`
2206
+ * accepts the standard JWT URI or 1claw's API-key URI:
2207
+ * - `urn:ietf:params:oauth:token-type:jwt`
2208
+ * - `urn:1claw:params:oauth:token-type:api-key`
2209
+ */
2210
+ TokenExchangeRequest: {
2211
+ /** @enum {string} */
2212
+ grant_type: "urn:ietf:params:oauth:grant-type:token-exchange";
2213
+ /** @description 1claw JWT or `ocv_` API key authorising the exchange. */
2214
+ subject_token: string;
2215
+ /** @enum {string} */
2216
+ subject_token_type: "urn:ietf:params:oauth:token-type:jwt" | "urn:1claw:params:oauth:token-type:api-key";
2217
+ /**
2218
+ * Format: uri
2219
+ * @description Required `aud` claim for the issued federation token (must be in agent's allowlist).
2220
+ * @example https://api.anthropic.com
2221
+ */
2222
+ audience: string;
2223
+ /** @description Optional space-separated subset of the agent's existing scopes. */
2224
+ scope?: string;
2225
+ /** @description Optional. Defaults to `urn:ietf:params:oauth:token-type:jwt`. */
2226
+ requested_token_type?: string;
2227
+ };
2228
+ TokenExchangeResponse: {
2229
+ /** @description RS256-signed federation JWT. */
2230
+ access_token: string;
2231
+ issued_token_type: string;
2232
+ token_type: string;
2233
+ expires_in: number;
2234
+ scope?: string;
2235
+ };
2045
2236
  SignupRequest: {
2046
2237
  /** Format: email */
2047
2238
  email: string;
@@ -2440,6 +2631,24 @@ export interface components {
2440
2631
  /** @description Enable/disable Shroud LLM Proxy */
2441
2632
  shroud_enabled?: boolean;
2442
2633
  shroud_config?: components["schemas"]["ShroudConfig"];
2634
+ /**
2635
+ * @description Enable OIDC federation (RFC 8693 token-exchange) for this agent.
2636
+ * When true, the agent may call POST /v1/auth/federated-token to mint
2637
+ * federation tokens for the audiences listed in `federation_audiences`.
2638
+ */
2639
+ federation_enabled?: boolean;
2640
+ /**
2641
+ * @description Allowlist of `aud` values the federation token-exchange may issue
2642
+ * tokens for (e.g. `["https://api.anthropic.com"]`). Empty array
2643
+ * blocks all federation requests (zero-trust default).
2644
+ */
2645
+ federation_audiences?: string[];
2646
+ /**
2647
+ * @description Per-agent TTL override for federation tokens (seconds). NULL falls
2648
+ * back to the global default (`ONECLAW_JWT_FEDERATED_TOKEN_EXPIRY_SECS`).
2649
+ * Hard-capped at 3600 seconds.
2650
+ */
2651
+ federated_token_ttl_seconds?: number | null;
2443
2652
  };
2444
2653
  AgentResponse: {
2445
2654
  /** Format: uuid */
@@ -2472,6 +2681,26 @@ export interface components {
2472
2681
  /** @description Whether this agent routes LLM traffic through the Shroud TEE proxy */
2473
2682
  shroud_enabled: boolean;
2474
2683
  shroud_config?: components["schemas"]["ShroudConfig"];
2684
+ /**
2685
+ * @description Whether this agent may mint OIDC federation tokens via
2686
+ * POST /v1/auth/federated-token. False by default.
2687
+ */
2688
+ federation_enabled?: boolean;
2689
+ /** @description Allowlist of audience URIs the agent may federate to. */
2690
+ federation_audiences?: string[];
2691
+ /** @description Per-agent TTL override for federation tokens (60..=3600). */
2692
+ federated_token_ttl_seconds?: number | null;
2693
+ /** @description Chains for which this agent has provisioned signing keys. */
2694
+ signing_chains?: string[];
2695
+ /** @description JSON array of allowed EIP-712 domain entries. */
2696
+ eip712_domain_allowlist?: Record<string, never>[];
2697
+ /**
2698
+ * @description Default EIP-712 policy (deny blocks all unless allowlisted).
2699
+ * @enum {string}
2700
+ */
2701
+ eip712_default_policy?: "deny" | "allow";
2702
+ /** @description Whether EIP-191 personal_sign is enabled. */
2703
+ message_signing_enabled?: boolean;
2475
2704
  /** Format: date-time */
2476
2705
  created_at: string;
2477
2706
  /** Format: date-time */
@@ -2927,6 +3156,64 @@ export interface components {
2927
3156
  SimulateBundleRequest: {
2928
3157
  transactions: components["schemas"]["SimulateTransactionRequest"][];
2929
3158
  };
3159
+ CreateSigningKeyRequest: {
3160
+ /** @enum {string} */
3161
+ chain: "ethereum" | "bitcoin" | "solana" | "xrp" | "cardano" | "tron";
3162
+ };
3163
+ SigningKeyResponse: {
3164
+ /** Format: uuid */
3165
+ id?: string;
3166
+ /** Format: uuid */
3167
+ agent_id?: string;
3168
+ chain?: string;
3169
+ curve?: string;
3170
+ public_key?: string;
3171
+ address?: string | null;
3172
+ key_version?: number;
3173
+ is_active?: boolean;
3174
+ /** Format: date-time */
3175
+ created_at?: string;
3176
+ /** Format: date-time */
3177
+ rotated_at?: string | null;
3178
+ };
3179
+ SigningKeyListResponse: {
3180
+ keys?: components["schemas"]["SigningKeyResponse"][];
3181
+ };
3182
+ SignIntentRequest: {
3183
+ /** @enum {string} */
3184
+ intent_type: "personal_sign" | "typed_data" | "transaction";
3185
+ chain: string;
3186
+ signing_key_path?: string;
3187
+ /** @description Hex-encoded message bytes (for personal_sign) */
3188
+ message?: string;
3189
+ /** @description EIP-712 typed data JSON (for typed_data) */
3190
+ typed_data?: Record<string, never>;
3191
+ /** @description EIP-2718 type: 0=legacy, 1=2930, 2=1559, 3=4844, 4=7702 */
3192
+ tx_type?: number;
3193
+ to?: string;
3194
+ value?: string;
3195
+ data?: string;
3196
+ nonce?: number;
3197
+ gas_limit?: number;
3198
+ gas_price?: string;
3199
+ max_fee_per_gas?: string;
3200
+ max_priority_fee_per_gas?: string;
3201
+ access_list?: Record<string, never>[];
3202
+ max_fee_per_blob_gas?: string;
3203
+ blob_versioned_hashes?: string[];
3204
+ authorization_list?: Record<string, never>[];
3205
+ };
3206
+ SignIntentResponse: {
3207
+ intent_type?: string;
3208
+ chain?: string;
3209
+ from?: string;
3210
+ signature?: string | null;
3211
+ signed_tx?: string | null;
3212
+ tx_hash?: string | null;
3213
+ message_hash?: string | null;
3214
+ typed_data_hash?: string | null;
3215
+ tx_type?: number | null;
3216
+ };
2930
3217
  TransactionResponse: {
2931
3218
  /** Format: uuid */
2932
3219
  id?: string;
@@ -3450,6 +3737,18 @@ export interface components {
3450
3737
  had_pii_detected?: boolean;
3451
3738
  injection_score?: number;
3452
3739
  policy_violations?: string[];
3740
+ /** @description Response-side prompt-injection score (0.0–1.0). */
3741
+ response_injection_score?: number;
3742
+ /** @description Response-side context-injection score (0.0–1.0). */
3743
+ response_context_injection_score?: number;
3744
+ /** @description Category tags emitted by the response-side filters (e.g. `markdown_image_exfil`, `data_uri_blob`, `echoed_instruction`). */
3745
+ response_injection_categories?: string[];
3746
+ /** @description URLs emitted by the model that were flagged as potential exfil / callback targets. */
3747
+ external_urls_flagged?: string[];
3748
+ /** @description Number of code fences in the response that were not expected for the agent's allowed task set. */
3749
+ unexpected_code_blocks?: number;
3750
+ /** @description True when Shroud rewrote or blocked response content before returning it to the agent. */
3751
+ content_filtered?: boolean;
3453
3752
  metadata?: Record<string, never>;
3454
3753
  /** Format: date-time */
3455
3754
  timestamp?: string;
@@ -3472,6 +3771,16 @@ export interface components {
3472
3771
  injection_score: number;
3473
3772
  policy_violations?: string[];
3474
3773
  metadata?: Record<string, never>;
3774
+ /** @default 0 */
3775
+ response_injection_score: number;
3776
+ /** @default 0 */
3777
+ response_context_injection_score: number;
3778
+ response_injection_categories?: string[];
3779
+ external_urls_flagged?: string[];
3780
+ /** @default 0 */
3781
+ unexpected_code_blocks: number;
3782
+ /** @default false */
3783
+ content_filtered: boolean;
3475
3784
  };
3476
3785
  ShroudThreatSummary: {
3477
3786
  /** Format: int64 */
@@ -3565,6 +3874,15 @@ export interface components {
3565
3874
  "application/json": components["schemas"]["PaymentRequirement"];
3566
3875
  };
3567
3876
  };
3877
+ /** @description Resource already exists or conflict */
3878
+ Conflict: {
3879
+ headers: {
3880
+ [name: string]: unknown;
3881
+ };
3882
+ content: {
3883
+ "application/json": components["schemas"]["ProblemDetails"];
3884
+ };
3885
+ };
3568
3886
  };
3569
3887
  parameters: {
3570
3888
  VaultId: string;
@@ -3727,6 +4045,83 @@ export interface operations {
3727
4045
  };
3728
4046
  };
3729
4047
  };
4048
+ exchangeFederatedToken: {
4049
+ parameters: {
4050
+ query?: never;
4051
+ header?: never;
4052
+ path?: never;
4053
+ cookie?: never;
4054
+ };
4055
+ requestBody: {
4056
+ content: {
4057
+ "application/json": components["schemas"]["TokenExchangeRequest"];
4058
+ "application/x-www-form-urlencoded": components["schemas"]["TokenExchangeRequest"];
4059
+ };
4060
+ };
4061
+ responses: {
4062
+ /** @description Federation token issued */
4063
+ 200: {
4064
+ headers: {
4065
+ [name: string]: unknown;
4066
+ };
4067
+ content: {
4068
+ "application/json": components["schemas"]["TokenExchangeResponse"];
4069
+ };
4070
+ };
4071
+ 400: components["responses"]["BadRequest"];
4072
+ 401: components["responses"]["Unauthorized"];
4073
+ 403: components["responses"]["Forbidden"];
4074
+ /** @description RS256 signing key not configured */
4075
+ 503: {
4076
+ headers: {
4077
+ [name: string]: unknown;
4078
+ };
4079
+ content?: never;
4080
+ };
4081
+ };
4082
+ };
4083
+ openidConfiguration: {
4084
+ parameters: {
4085
+ query?: never;
4086
+ header?: never;
4087
+ path?: never;
4088
+ cookie?: never;
4089
+ };
4090
+ requestBody?: never;
4091
+ responses: {
4092
+ /** @description Discovery document */
4093
+ 200: {
4094
+ headers: {
4095
+ [name: string]: unknown;
4096
+ };
4097
+ content: {
4098
+ "application/json": Record<string, never>;
4099
+ };
4100
+ };
4101
+ };
4102
+ };
4103
+ jwks: {
4104
+ parameters: {
4105
+ query?: never;
4106
+ header?: never;
4107
+ path?: never;
4108
+ cookie?: never;
4109
+ };
4110
+ requestBody?: never;
4111
+ responses: {
4112
+ /** @description JWK Set */
4113
+ 200: {
4114
+ headers: {
4115
+ [name: string]: unknown;
4116
+ };
4117
+ content: {
4118
+ "application/jwk-set+json": {
4119
+ keys?: Record<string, never>[];
4120
+ };
4121
+ };
4122
+ };
4123
+ };
4124
+ };
3730
4125
  signup: {
3731
4126
  parameters: {
3732
4127
  query?: never;
@@ -5295,6 +5690,130 @@ export interface operations {
5295
5690
  402: components["responses"]["PaymentRequired"];
5296
5691
  };
5297
5692
  };
5693
+ listSigningKeys: {
5694
+ parameters: {
5695
+ query?: never;
5696
+ header?: never;
5697
+ path: {
5698
+ agent_id: components["parameters"]["AgentId"];
5699
+ };
5700
+ cookie?: never;
5701
+ };
5702
+ requestBody?: never;
5703
+ responses: {
5704
+ /** @description Signing keys list */
5705
+ 200: {
5706
+ headers: {
5707
+ [name: string]: unknown;
5708
+ };
5709
+ content: {
5710
+ "application/json": components["schemas"]["SigningKeyListResponse"];
5711
+ };
5712
+ };
5713
+ };
5714
+ };
5715
+ createSigningKey: {
5716
+ parameters: {
5717
+ query?: never;
5718
+ header?: never;
5719
+ path: {
5720
+ agent_id: components["parameters"]["AgentId"];
5721
+ };
5722
+ cookie?: never;
5723
+ };
5724
+ requestBody: {
5725
+ content: {
5726
+ "application/json": components["schemas"]["CreateSigningKeyRequest"];
5727
+ };
5728
+ };
5729
+ responses: {
5730
+ /** @description Signing key created */
5731
+ 201: {
5732
+ headers: {
5733
+ [name: string]: unknown;
5734
+ };
5735
+ content: {
5736
+ "application/json": components["schemas"]["SigningKeyResponse"];
5737
+ };
5738
+ };
5739
+ 400: components["responses"]["BadRequest"];
5740
+ 409: components["responses"]["Conflict"];
5741
+ };
5742
+ };
5743
+ rotateSigningKey: {
5744
+ parameters: {
5745
+ query?: never;
5746
+ header?: never;
5747
+ path: {
5748
+ agent_id: components["parameters"]["AgentId"];
5749
+ chain: string;
5750
+ };
5751
+ cookie?: never;
5752
+ };
5753
+ requestBody?: never;
5754
+ responses: {
5755
+ /** @description Rotated signing key */
5756
+ 200: {
5757
+ headers: {
5758
+ [name: string]: unknown;
5759
+ };
5760
+ content: {
5761
+ "application/json": components["schemas"]["SigningKeyResponse"];
5762
+ };
5763
+ };
5764
+ 404: components["responses"]["NotFound"];
5765
+ };
5766
+ };
5767
+ deactivateSigningKey: {
5768
+ parameters: {
5769
+ query?: never;
5770
+ header?: never;
5771
+ path: {
5772
+ agent_id: components["parameters"]["AgentId"];
5773
+ chain: string;
5774
+ };
5775
+ cookie?: never;
5776
+ };
5777
+ requestBody?: never;
5778
+ responses: {
5779
+ /** @description Key deactivated */
5780
+ 204: {
5781
+ headers: {
5782
+ [name: string]: unknown;
5783
+ };
5784
+ content?: never;
5785
+ };
5786
+ 404: components["responses"]["NotFound"];
5787
+ };
5788
+ };
5789
+ signIntent: {
5790
+ parameters: {
5791
+ query?: never;
5792
+ header?: never;
5793
+ path: {
5794
+ agent_id: components["parameters"]["AgentId"];
5795
+ };
5796
+ cookie?: never;
5797
+ };
5798
+ requestBody: {
5799
+ content: {
5800
+ "application/json": components["schemas"]["SignIntentRequest"];
5801
+ };
5802
+ };
5803
+ responses: {
5804
+ /** @description Signed result */
5805
+ 200: {
5806
+ headers: {
5807
+ [name: string]: unknown;
5808
+ };
5809
+ content: {
5810
+ "application/json": components["schemas"]["SignIntentResponse"];
5811
+ };
5812
+ };
5813
+ 400: components["responses"]["BadRequest"];
5814
+ 403: components["responses"]["Forbidden"];
5815
+ };
5816
+ };
5298
5817
  listChains: {
5299
5818
  parameters: {
5300
5819
  query?: never;