@tangle-network/agent-interface 5.2.0 → 5.3.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.
Files changed (38) hide show
  1. package/dist/agent-candidate-code-schema.d.ts +63 -14
  2. package/dist/agent-candidate-code-schema.js +2 -1
  3. package/dist/agent-candidate-execution-plan-schema.d.ts +262 -20
  4. package/dist/agent-candidate-execution-plan-schema.js +30 -7
  5. package/dist/agent-candidate-profile-schema.d.ts +63 -8
  6. package/dist/agent-candidate-profile-schema.js +2 -0
  7. package/dist/agent-candidate-promotion-schema.d.ts +952 -100
  8. package/dist/agent-candidate-receipt-schema.d.ts +104 -8
  9. package/dist/agent-candidate-schema-common.d.ts +30 -3
  10. package/dist/agent-candidate-schema-common.js +14 -8
  11. package/dist/agent-candidate-schema.d.ts +72 -10
  12. package/dist/agent-candidate.d.ts +12 -4
  13. package/dist/agent-execution-preparation-receipt.d.ts +2 -0
  14. package/dist/agent-execution-preparation.js +4 -2
  15. package/dist/agent-profile-materialization.d.ts +1 -1
  16. package/dist/agent-profile-materialization.js +3 -0
  17. package/dist/agent-profile.d.ts +6 -0
  18. package/dist/agent-profile.js +9 -2
  19. package/dist/environment-interactive-control.d.ts +10 -0
  20. package/dist/environment-interactive-start.d.ts +33 -6
  21. package/dist/environment-profile-capabilities.d.ts +18 -0
  22. package/dist/environment-profile-capabilities.js +2 -0
  23. package/dist/environment-provider.d.ts +1 -0
  24. package/dist/environment-provider.js +1 -0
  25. package/dist/environment-runtime.d.ts +176 -18
  26. package/dist/environment-runtime.js +14 -1
  27. package/dist/harness-capabilities.js +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +1 -0
  30. package/dist/portable-context-transfer.d.ts +33 -6
  31. package/dist/profile-diff.d.ts +4 -3
  32. package/dist/profile-diff.js +11 -0
  33. package/dist/profile-schema.d.ts +50 -21
  34. package/dist/profile-schema.js +6 -13
  35. package/dist/proxy-secrets.d.ts +329 -0
  36. package/dist/proxy-secrets.js +183 -0
  37. package/fixtures/proxy-secret-wire-v1.json +1119 -0
  38. package/package.json +2 -1
@@ -223,22 +223,62 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
223
223
  kind: "agent-profile-workspace-plan";
224
224
  digest: `sha256:${string}`;
225
225
  material: {
226
+ proxySecrets?: {
227
+ hosts: readonly string[];
228
+ methods?: readonly string[] | undefined;
229
+ paths?: readonly string[] | undefined;
230
+ envName: string;
231
+ secretRef: {
232
+ kind: "secret-ref";
233
+ key: string;
234
+ };
235
+ presentation: {
236
+ type: "bearer";
237
+ } | {
238
+ type: "basic";
239
+ username: string;
240
+ } | {
241
+ type: "header";
242
+ name: string;
243
+ } | {
244
+ type: "query";
245
+ name: string;
246
+ };
247
+ placeholderFormat?: "jwt" | "opaque" | undefined;
248
+ ttlSeconds?: number | undefined;
249
+ }[] | undefined;
226
250
  sourceProfileDigest: `sha256:${string}`;
227
251
  harness: "acp" | "amp" | "claude-code" | "cli-base" | "codex" | "cursor" | "factory-droids" | "forge" | "gemini" | "hermes" | "kimi-code" | "nanoclaw" | "openclaw" | "opencode" | "pi" | "prime";
228
252
  files: {
229
253
  relPath: string;
230
254
  mode: number;
231
255
  contentSha256: `sha256:${string}`;
256
+ secretSlots?: {
257
+ path: (string | number)[];
258
+ ref: {
259
+ kind: "secret-ref";
260
+ key: string;
261
+ format?: "bearer" | "raw" | undefined;
262
+ };
263
+ }[] | undefined;
232
264
  root?: "agent" | undefined;
233
265
  }[];
234
266
  env: Record<string, {
267
+ kind: "secret-ref";
268
+ key: string;
269
+ format?: "bearer" | "raw" | undefined;
270
+ } | {
235
271
  kind: "public";
236
272
  value: string;
237
273
  }>;
238
- flags: {
274
+ flags: ({
275
+ kind: "secret-ref";
276
+ key: string;
277
+ format?: "bearer" | "raw" | undefined;
278
+ } | {
239
279
  kind: "public";
240
280
  value: string;
241
- }[];
281
+ })[];
242
282
  systemPrompt?: {
243
283
  kind: "public";
244
284
  value: string;
@@ -279,22 +319,62 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
279
319
  kind: "agent-profile-workspace-plan";
280
320
  digest: `sha256:${string}`;
281
321
  material: {
322
+ proxySecrets?: {
323
+ hosts: readonly string[];
324
+ methods?: readonly string[] | undefined;
325
+ paths?: readonly string[] | undefined;
326
+ envName: string;
327
+ secretRef: {
328
+ kind: "secret-ref";
329
+ key: string;
330
+ };
331
+ presentation: {
332
+ type: "bearer";
333
+ } | {
334
+ type: "basic";
335
+ username: string;
336
+ } | {
337
+ type: "header";
338
+ name: string;
339
+ } | {
340
+ type: "query";
341
+ name: string;
342
+ };
343
+ placeholderFormat?: "jwt" | "opaque" | undefined;
344
+ ttlSeconds?: number | undefined;
345
+ }[] | undefined;
282
346
  sourceProfileDigest: `sha256:${string}`;
283
347
  harness: "acp" | "amp" | "claude-code" | "cli-base" | "codex" | "cursor" | "factory-droids" | "forge" | "gemini" | "hermes" | "kimi-code" | "nanoclaw" | "openclaw" | "opencode" | "pi" | "prime";
284
348
  files: {
285
349
  relPath: string;
286
350
  mode: number;
287
351
  contentSha256: `sha256:${string}`;
352
+ secretSlots?: {
353
+ path: (string | number)[];
354
+ ref: {
355
+ kind: "secret-ref";
356
+ key: string;
357
+ format?: "bearer" | "raw" | undefined;
358
+ };
359
+ }[] | undefined;
288
360
  root?: "agent" | undefined;
289
361
  }[];
290
362
  env: Record<string, {
363
+ kind: "secret-ref";
364
+ key: string;
365
+ format?: "bearer" | "raw" | undefined;
366
+ } | {
291
367
  kind: "public";
292
368
  value: string;
293
369
  }>;
294
- flags: {
370
+ flags: ({
371
+ kind: "secret-ref";
372
+ key: string;
373
+ format?: "bearer" | "raw" | undefined;
374
+ } | {
295
375
  kind: "public";
296
376
  value: string;
297
- }[];
377
+ })[];
298
378
  systemPrompt?: {
299
379
  kind: "public";
300
380
  value: string;
@@ -496,11 +576,19 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
496
576
  };
497
577
  launch: {
498
578
  executable: string;
499
- args: {
579
+ args: ({
580
+ kind: "secret-ref";
581
+ key: string;
582
+ format?: "bearer" | "raw" | undefined;
583
+ } | {
500
584
  kind: "public";
501
585
  value: string;
502
- }[];
586
+ })[];
503
587
  env: Record<string, {
588
+ kind: "secret-ref";
589
+ key: string;
590
+ format?: "bearer" | "raw" | undefined;
591
+ } | {
504
592
  kind: "public";
505
593
  value: string;
506
594
  }>;
@@ -760,11 +848,19 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
760
848
  };
761
849
  launch: {
762
850
  executable: string;
763
- args: {
851
+ args: ({
852
+ kind: "secret-ref";
853
+ key: string;
854
+ format?: "bearer" | "raw" | undefined;
855
+ } | {
764
856
  kind: "public";
765
857
  value: string;
766
- }[];
858
+ })[];
767
859
  env: Record<string, {
860
+ kind: "secret-ref";
861
+ key: string;
862
+ format?: "bearer" | "raw" | undefined;
863
+ } | {
768
864
  kind: "public";
769
865
  value: string;
770
866
  }>;
@@ -32,14 +32,41 @@ export declare function isCanonicalJsonValue(value: unknown, ancestors?: Set<obj
32
32
  * core calls it, so candidate validation and trace redaction agree.
33
33
  */
34
34
  export declare function looksLikeCredential(value: string): boolean;
35
- export declare const agentCandidateConfigValueSchema: z.ZodObject<{
35
+ /** Shared public reference owner; resolution belongs to the trusted executor. */
36
+ export declare const agentCandidateSecretRefSchema: z.ZodObject<{
37
+ kind: z.ZodLiteral<"secret-ref">;
38
+ key: z.ZodString;
39
+ format: z.ZodOptional<z.ZodEnum<{
40
+ bearer: "bearer";
41
+ raw: "raw";
42
+ }>>;
43
+ }, z.core.$strict>;
44
+ export declare const agentCandidatePublicValueSchema: z.ZodObject<{
36
45
  kind: z.ZodLiteral<"public">;
37
46
  value: z.ZodString;
38
47
  }, z.core.$strict>;
39
- export declare const environmentConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
48
+ export declare const agentCandidateConfigValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
49
+ kind: z.ZodLiteral<"public">;
50
+ value: z.ZodString;
51
+ }, z.core.$strict>, z.ZodObject<{
52
+ kind: z.ZodLiteral<"secret-ref">;
53
+ key: z.ZodString;
54
+ format: z.ZodOptional<z.ZodEnum<{
55
+ bearer: "bearer";
56
+ raw: "raw";
57
+ }>>;
58
+ }, z.core.$strict>], "kind">;
59
+ export declare const environmentConfigSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
40
60
  kind: z.ZodLiteral<"public">;
41
61
  value: z.ZodString;
42
- }, z.core.$strict>>;
62
+ }, z.core.$strict>, z.ZodObject<{
63
+ kind: z.ZodLiteral<"secret-ref">;
64
+ key: z.ZodString;
65
+ format: z.ZodOptional<z.ZodEnum<{
66
+ bearer: "bearer";
67
+ raw: "raw";
68
+ }>>;
69
+ }, z.core.$strict>], "kind">>;
43
70
  export declare const agentCandidateGitHubRepositorySchema: z.ZodObject<{
44
71
  kind: z.ZodLiteral<"github">;
45
72
  owner: z.ZodString;
@@ -239,20 +239,26 @@ function isPublicConfigValue(value) {
239
239
  isWellFormedUnicode(value) &&
240
240
  !looksLikeCredential(value));
241
241
  }
242
- export const agentCandidateConfigValueSchema = z
243
- .object({
242
+ /** Shared public reference owner; resolution belongs to the trusted executor. */
243
+ export const agentCandidateSecretRefSchema = z.strictObject({
244
+ kind: z.literal("secret-ref"),
245
+ key: z.string().min(1).max(500).refine((value) => value.trim().length > 0 && isPublicConfigValue(value), "secret reference key must be a public non-credential identity"),
246
+ format: z.enum(["raw", "bearer"]).optional(),
247
+ });
248
+ export const agentCandidatePublicValueSchema = z.strictObject({
244
249
  kind: z.literal("public"),
245
- value: z
246
- .string()
247
- .refine(isPublicConfigValue, "candidate config cannot carry credentials; the evaluator owns model authorization"),
248
- })
249
- .strict();
250
+ value: z.string().refine(isPublicConfigValue, "candidate config cannot carry credentials; the evaluator owns model authorization"),
251
+ });
252
+ export const agentCandidateConfigValueSchema = z.discriminatedUnion("kind", [
253
+ agentCandidatePublicValueSchema,
254
+ agentCandidateSecretRefSchema,
255
+ ]);
250
256
  function configRecordSchema(keySchema) {
251
257
  return z
252
258
  .record(keySchema, agentCandidateConfigValueSchema)
253
259
  .superRefine((config, ctx) => {
254
260
  for (const name of Object.keys(config)) {
255
- if (secretNamePattern.test(name)) {
261
+ if (secretNamePattern.test(name) && config[name]?.kind !== "secret-ref") {
256
262
  ctx.addIssue({
257
263
  code: "custom",
258
264
  path: [name],
@@ -55,6 +55,33 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
55
55
  pi: "pi";
56
56
  prime: "prime";
57
57
  }>>;
58
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
60
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
61
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
62
+ envName: z.ZodString;
63
+ secretRef: z.ZodObject<{
64
+ kind: z.ZodLiteral<"secret-ref">;
65
+ key: z.ZodString;
66
+ }, z.core.$strict>;
67
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
+ type: z.ZodLiteral<"bearer">;
69
+ }, z.core.$strict>, z.ZodObject<{
70
+ type: z.ZodLiteral<"basic">;
71
+ username: z.ZodString;
72
+ }, z.core.$strict>, z.ZodObject<{
73
+ type: z.ZodLiteral<"header">;
74
+ name: z.ZodString;
75
+ }, z.core.$strict>, z.ZodObject<{
76
+ type: z.ZodLiteral<"query">;
77
+ name: z.ZodString;
78
+ }, z.core.$strict>], "type">;
79
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
80
+ jwt: "jwt";
81
+ opaque: "opaque";
82
+ }>>;
83
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
84
+ }, z.core.$strict>>>;
58
85
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
59
86
  allow: "allow";
60
87
  ask: "ask";
@@ -533,17 +560,31 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
533
560
  }, z.core.$strict>>;
534
561
  hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
535
562
  executable: z.ZodString;
536
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
563
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
537
564
  kind: z.ZodLiteral<"public">;
538
565
  value: z.ZodString;
539
- }, z.core.$strict>>>;
566
+ }, z.core.$strict>, z.ZodObject<{
567
+ kind: z.ZodLiteral<"secret-ref">;
568
+ key: z.ZodString;
569
+ format: z.ZodOptional<z.ZodEnum<{
570
+ bearer: "bearer";
571
+ raw: "raw";
572
+ }>>;
573
+ }, z.core.$strict>], "kind">>>;
540
574
  timeoutMs: z.ZodOptional<z.ZodNumber>;
541
575
  blocking: z.ZodOptional<z.ZodBoolean>;
542
576
  matcher: z.ZodOptional<z.ZodString>;
543
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
577
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
544
578
  kind: z.ZodLiteral<"public">;
545
579
  value: z.ZodString;
546
- }, z.core.$strict>>>;
580
+ }, z.core.$strict>, z.ZodObject<{
581
+ kind: z.ZodLiteral<"secret-ref">;
582
+ key: z.ZodString;
583
+ format: z.ZodOptional<z.ZodEnum<{
584
+ bearer: "bearer";
585
+ raw: "raw";
586
+ }>>;
587
+ }, z.core.$strict>], "kind">>>;
547
588
  }, z.core.$strict>>>>;
548
589
  modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
549
590
  description: z.ZodOptional<z.ZodString>;
@@ -614,10 +655,17 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
614
655
  launch: z.ZodDiscriminatedUnion<[z.ZodObject<{
615
656
  kind: z.ZodLiteral<"container-command">;
616
657
  executable: z.ZodString;
617
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
658
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
618
659
  kind: z.ZodLiteral<"public">;
619
660
  value: z.ZodString;
620
- }, z.core.$strict>>>;
661
+ }, z.core.$strict>, z.ZodObject<{
662
+ kind: z.ZodLiteral<"secret-ref">;
663
+ key: z.ZodString;
664
+ format: z.ZodOptional<z.ZodEnum<{
665
+ bearer: "bearer";
666
+ raw: "raw";
667
+ }>>;
668
+ }, z.core.$strict>], "kind">>>;
621
669
  }, z.core.$strict>, z.ZodObject<{
622
670
  kind: z.ZodLiteral<"candidate-entrypoint">;
623
671
  entrypoint: z.ZodString;
@@ -630,10 +678,17 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
630
678
  tsx: "tsx";
631
679
  uv: "uv";
632
680
  }>>;
633
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
681
+ args: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
634
682
  kind: z.ZodLiteral<"public">;
635
683
  value: z.ZodString;
636
- }, z.core.$strict>>>;
684
+ }, z.core.$strict>, z.ZodObject<{
685
+ kind: z.ZodLiteral<"secret-ref">;
686
+ key: z.ZodString;
687
+ format: z.ZodOptional<z.ZodEnum<{
688
+ bearer: "bearer";
689
+ raw: "raw";
690
+ }>>;
691
+ }, z.core.$strict>], "kind">>>;
637
692
  }, z.core.$strict>], "kind">;
638
693
  instructionDelivery: z.ZodDiscriminatedUnion<[z.ZodObject<{
639
694
  kind: z.ZodLiteral<"argv-append">;
@@ -651,10 +706,17 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
651
706
  }>;
652
707
  path: z.ZodString;
653
708
  }, z.core.$strict>;
654
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
709
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
655
710
  kind: z.ZodLiteral<"public">;
656
711
  value: z.ZodString;
657
- }, z.core.$strict>>>;
712
+ }, z.core.$strict>, z.ZodObject<{
713
+ kind: z.ZodLiteral<"secret-ref">;
714
+ key: z.ZodString;
715
+ format: z.ZodOptional<z.ZodEnum<{
716
+ bearer: "bearer";
717
+ raw: "raw";
718
+ }>>;
719
+ }, z.core.$strict>], "kind">>>;
658
720
  environment: z.ZodDiscriminatedUnion<[z.ZodObject<{
659
721
  kind: z.ZodLiteral<"pinned-container">;
660
722
  container: z.ZodObject<{
@@ -1,4 +1,5 @@
1
- import type { AgentProfile, AgentProfileFileMount, AgentProfileHookCommand, AgentProfileMode, AgentProfileModelHints, AgentProfileResources, AgentSubagentProfile, ReasoningEffort } from "./agent-profile.js";
1
+ import type { AgentProfile, AgentProfileFileMount, AgentProfileHookCommand, AgentProfileMode, AgentProfileModelHints, AgentProfileSecretRef, AgentProfileResources, AgentSubagentProfile, ReasoningEffort } from "./agent-profile.js";
2
+ import type { ProxySecretBinding } from "./proxy-secrets.js";
2
3
  import type { AgentProfileActivationEvidence } from "./agent-profile-activation.js";
3
4
  import type { HarnessType } from "./harness.js";
4
5
  import type { AgentProfileImprovementExecutionRef, AgentProfileImprovementMeasuredComparison } from "./agent-profile-improvement.js";
@@ -63,7 +64,7 @@ export interface AgentCandidatePublicValue {
63
64
  kind: "public";
64
65
  value: string;
65
66
  }
66
- export type AgentCandidateConfigValue = AgentCandidatePublicValue;
67
+ export type AgentCandidateConfigValue = AgentCandidatePublicValue | AgentProfileSecretRef;
67
68
  export interface AgentCandidateGitHubRepository {
68
69
  kind: "github";
69
70
  owner: string;
@@ -373,6 +374,8 @@ export interface AgentCandidateResolvedModel {
373
374
  }
374
375
  /** Canonical, digest-free profile-plan identity document. */
375
376
  export interface AgentCandidateProfilePlanMaterial {
377
+ /** Reference-only declaration captured with the public plan before trusted resolution. */
378
+ proxySecrets?: ProxySecretBinding[];
376
379
  /** Canonical digest of the complete frozen profile that produced this plan. */
377
380
  sourceProfileDigest: Sha256Digest;
378
381
  harness: HarnessType;
@@ -380,6 +383,11 @@ export interface AgentCandidateProfilePlanMaterial {
380
383
  relPath: string;
381
384
  mode: number;
382
385
  contentSha256: Sha256Digest;
386
+ /** Public reference placements in the null-valued JSON template; part of plan identity. */
387
+ secretSlots?: Array<{
388
+ path: Array<string | number>;
389
+ ref: AgentProfileSecretRef;
390
+ }>;
383
391
  /** Omit for a workspace-root file; agent-root files must name this root. */
384
392
  root?: "agent";
385
393
  }>;
@@ -390,14 +398,14 @@ export interface AgentCandidateProfilePlanMaterial {
390
398
  * Present only where the harness's own system prompt is deleted in favor of
391
399
  * this text.
392
400
  */
393
- systemPrompt?: AgentCandidateConfigValue;
401
+ systemPrompt?: AgentCandidatePublicValue;
394
402
  /**
395
403
  * Exact text ADDED to the harness's own system prompt, which stays intact.
396
404
  * Recorded separately from the replacement so plan identity distinguishes the
397
405
  * two intents; a harness that lowers this into a flag or file still records
398
406
  * it here, because the same bytes in the two fields are two different runs.
399
407
  */
400
- appendSystemPrompt?: AgentCandidateConfigValue;
408
+ appendSystemPrompt?: AgentCandidatePublicValue;
401
409
  unsupported: Array<{
402
410
  dimension: string;
403
411
  reason: string;
@@ -122,6 +122,7 @@ export declare const agentExecutionPreparationAxisResultSchema: z.ZodObject<{
122
122
  modes: "modes";
123
123
  name: "name";
124
124
  permissions: "permissions";
125
+ proxySecrets: "proxySecrets";
125
126
  resourceAgents: "resourceAgents";
126
127
  resourceFailOnError: "resourceFailOnError";
127
128
  resourceInstructions: "resourceInstructions";
@@ -275,6 +276,7 @@ export declare const agentExecutionPreparationReceiptSchema: z.ZodObject<{
275
276
  modes: "modes";
276
277
  name: "name";
277
278
  permissions: "permissions";
279
+ proxySecrets: "proxySecrets";
278
280
  resourceAgents: "resourceAgents";
279
281
  resourceFailOnError: "resourceFailOnError";
280
282
  resourceInstructions: "resourceInstructions";
@@ -353,11 +353,13 @@ function validateAxisCoverage(receipt, authoredProfile, effectiveProfile, issues
353
353
  path: request.path,
354
354
  });
355
355
  }
356
- if (coverage.result.disposition === "unsupported" && !allowPartial) {
356
+ if (coverage.result.disposition === "unsupported" && (!allowPartial || request.axis === "proxySecrets")) {
357
357
  issues.push({
358
358
  code: "strict-unsupported",
359
359
  message: `${request.axis} at ${request.path} is unsupported but the authored ` +
360
- "profile did not explicitly set resources.failOnError=false",
360
+ (request.axis === "proxySecrets"
361
+ ? "proxy-secret custody cannot be omitted by partial materialization"
362
+ : "profile did not explicitly set resources.failOnError=false"),
361
363
  axis: request.axis,
362
364
  path: request.path,
363
365
  });
@@ -9,7 +9,7 @@ import type { AgentProfile } from "./agent-profile.js";
9
9
  * can only add text must report the requested replacement as unsatisfied rather
10
10
  * than acknowledge it.
11
11
  */
12
- export declare const AGENT_PROFILE_MATERIALIZATION_AXES: readonly ["name", "description", "version", "tags", "systemPrompt", "appendSystemPrompt", "instructions", "modelDefault", "modelSmall", "modelProvider", "modelReasoningEffort", "modelMaxVisibleOutputTokens", "modelMaxReasoningTokens", "modelMaxTotalOutputTokens", "modelMetadata", "harness", "seats", "permissions", "tools", "mcp", "connections", "subagents", "files", "resourceTools", "skills", "resourceAgents", "commands", "knowledge", "resourceInstructions", "resourceFailOnError", "hooks", "modes", "confidential", "metadata", "extensions"];
12
+ export declare const AGENT_PROFILE_MATERIALIZATION_AXES: readonly ["name", "description", "version", "tags", "systemPrompt", "appendSystemPrompt", "instructions", "modelDefault", "modelSmall", "modelProvider", "modelReasoningEffort", "modelMaxVisibleOutputTokens", "modelMaxReasoningTokens", "modelMaxTotalOutputTokens", "modelMetadata", "harness", "seats", "proxySecrets", "permissions", "tools", "mcp", "connections", "subagents", "files", "resourceTools", "skills", "resourceAgents", "commands", "knowledge", "resourceInstructions", "resourceFailOnError", "hooks", "modes", "confidential", "metadata", "extensions"];
13
13
  /** One exact leaf of the public AgentProfile contract. */
14
14
  export type AgentProfileMaterializationAxis = (typeof AGENT_PROFILE_MATERIALIZATION_AXES)[number];
15
15
  /** Compatibility name used by runtimes that distinguish canonical axes. */
@@ -26,6 +26,7 @@ export const AGENT_PROFILE_MATERIALIZATION_AXES = [
26
26
  "modelMetadata",
27
27
  "harness",
28
28
  "seats",
29
+ "proxySecrets",
29
30
  "permissions",
30
31
  "tools",
31
32
  "mcp",
@@ -50,6 +51,7 @@ const profileProperties = [
50
51
  "model",
51
52
  "harness",
52
53
  "seats",
54
+ "proxySecrets",
53
55
  "permissions",
54
56
  "tools",
55
57
  "mcp",
@@ -105,6 +107,7 @@ const AXIS_DESCRIPTORS = [
105
107
  })),
106
108
  { axis: "harness", rootPath: "/harness", value: (profile) => profile.harness },
107
109
  { axis: "seats", rootPath: "/seats", value: (profile) => profile.seats },
110
+ { axis: "proxySecrets", rootPath: "/proxySecrets", value: (profile) => profile.proxySecrets },
108
111
  {
109
112
  axis: "permissions",
110
113
  rootPath: "/permissions",
@@ -11,6 +11,7 @@
11
11
  * secret references, which a private executor resolves only after identity is
12
12
  * fixed. This package is the canonical public home for these symbols.
13
13
  */
14
+ import type { ProxySecretBinding, ProxySecretCapabilities } from "./proxy-secrets.js";
14
15
  import type { HarnessType } from "./harness.js";
15
16
  import type { Sha256Digest } from "./agent-candidate.js";
16
17
  /**
@@ -448,6 +449,9 @@ export interface AgentProfile {
448
449
  * Omission preserves the existing single-provider execution policy.
449
450
  */
450
451
  seats?: AgentProfileSeat[];
452
+ /** Reference-only proxy custody. Overlay replaces the entire selection; [] clears it.
453
+ * Authorization and issuer scope remain outside this authored profile. */
454
+ proxySecrets?: ProxySecretBinding[];
451
455
  permissions?: Record<string, AgentProfilePermission>;
452
456
  tools?: Record<string, boolean>;
453
457
  mcp?: Record<string, AgentProfileMcpServer>;
@@ -499,6 +503,8 @@ export interface AgentProfileSystemPromptCapability {
499
503
  */
500
504
  export interface AgentProfileCapabilities {
501
505
  namedProfiles: boolean;
506
+ /** Absent means proxy-only profiles must be refused before secret resolution. */
507
+ proxySecrets?: ProxySecretCapabilities;
502
508
  systemPrompt: AgentProfileSystemPromptCapability;
503
509
  instructions: boolean;
504
510
  tools: boolean;
@@ -96,8 +96,15 @@ function assignDefined(...sources) {
96
96
  if (source === undefined)
97
97
  continue;
98
98
  for (const [key, value] of Object.entries(source)) {
99
- if (value !== undefined)
100
- merged[key] = value;
99
+ if (value !== undefined) {
100
+ // Define own data properties like object spread, including __proto__.
101
+ Object.defineProperty(merged, key, {
102
+ value,
103
+ enumerable: true,
104
+ configurable: true,
105
+ writable: true,
106
+ });
107
+ }
101
108
  }
102
109
  }
103
110
  return merged;
@@ -116,6 +116,7 @@ export declare const AgentInteractiveSessionRefSchema: z.ZodObject<{
116
116
  modes: "modes";
117
117
  name: "name";
118
118
  permissions: "permissions";
119
+ proxySecrets: "proxySecrets";
119
120
  resourceAgents: "resourceAgents";
120
121
  resourceFailOnError: "resourceFailOnError";
121
122
  resourceInstructions: "resourceInstructions";
@@ -293,6 +294,7 @@ export declare const AgentInteractiveSessionControlClaimRequestSchema: z.ZodObje
293
294
  modes: "modes";
294
295
  name: "name";
295
296
  permissions: "permissions";
297
+ proxySecrets: "proxySecrets";
296
298
  resourceAgents: "resourceAgents";
297
299
  resourceFailOnError: "resourceFailOnError";
298
300
  resourceInstructions: "resourceInstructions";
@@ -463,6 +465,7 @@ export declare const AgentInteractiveSessionControlClaimAcknowledgementSchema: z
463
465
  modes: "modes";
464
466
  name: "name";
465
467
  permissions: "permissions";
468
+ proxySecrets: "proxySecrets";
466
469
  resourceAgents: "resourceAgents";
467
470
  resourceFailOnError: "resourceFailOnError";
468
471
  resourceInstructions: "resourceInstructions";
@@ -654,6 +657,7 @@ export declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnio
654
657
  modes: "modes";
655
658
  name: "name";
656
659
  permissions: "permissions";
660
+ proxySecrets: "proxySecrets";
657
661
  resourceAgents: "resourceAgents";
658
662
  resourceFailOnError: "resourceFailOnError";
659
663
  resourceInstructions: "resourceInstructions";
@@ -804,6 +808,7 @@ export declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnio
804
808
  modes: "modes";
805
809
  name: "name";
806
810
  permissions: "permissions";
811
+ proxySecrets: "proxySecrets";
807
812
  resourceAgents: "resourceAgents";
808
813
  resourceFailOnError: "resourceFailOnError";
809
814
  resourceInstructions: "resourceInstructions";
@@ -962,6 +967,7 @@ export declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnio
962
967
  modes: "modes";
963
968
  name: "name";
964
969
  permissions: "permissions";
970
+ proxySecrets: "proxySecrets";
965
971
  resourceAgents: "resourceAgents";
966
972
  resourceFailOnError: "resourceFailOnError";
967
973
  resourceInstructions: "resourceInstructions";
@@ -1125,6 +1131,7 @@ export declare const AgentInteractiveSessionStopCommandSchema: z.ZodObject<{
1125
1131
  modes: "modes";
1126
1132
  name: "name";
1127
1133
  permissions: "permissions";
1134
+ proxySecrets: "proxySecrets";
1128
1135
  resourceAgents: "resourceAgents";
1129
1136
  resourceFailOnError: "resourceFailOnError";
1130
1137
  resourceInstructions: "resourceInstructions";
@@ -1297,6 +1304,7 @@ export declare const AgentInteractiveSessionStopAcknowledgementSchema: z.ZodObje
1297
1304
  modes: "modes";
1298
1305
  name: "name";
1299
1306
  permissions: "permissions";
1307
+ proxySecrets: "proxySecrets";
1300
1308
  resourceAgents: "resourceAgents";
1301
1309
  resourceFailOnError: "resourceFailOnError";
1302
1310
  resourceInstructions: "resourceInstructions";
@@ -1485,6 +1493,7 @@ export declare const AgentInteractiveSessionPromptCommandSchema: z.ZodObject<{
1485
1493
  modes: "modes";
1486
1494
  name: "name";
1487
1495
  permissions: "permissions";
1496
+ proxySecrets: "proxySecrets";
1488
1497
  resourceAgents: "resourceAgents";
1489
1498
  resourceFailOnError: "resourceFailOnError";
1490
1499
  resourceInstructions: "resourceInstructions";
@@ -1656,6 +1665,7 @@ export declare const AgentInteractiveSessionPromptAcknowledgementSchema: z.ZodOb
1656
1665
  modes: "modes";
1657
1666
  name: "name";
1658
1667
  permissions: "permissions";
1668
+ proxySecrets: "proxySecrets";
1659
1669
  resourceAgents: "resourceAgents";
1660
1670
  resourceFailOnError: "resourceFailOnError";
1661
1671
  resourceInstructions: "resourceInstructions";