feat: agent instructions path API with chain-of-command authz

Add PATCH /agents/:id/instructions-path endpoint for setting or clearing
an agent's instructions file path. Supports relative path resolution
against adapterConfig.cwd. Enforce chain-of-command authorization —
only the agent itself, board members, or ancestor managers can update.
Guard instructions path keys in the general agent update endpoint too.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dotta
2026-03-02 14:21:24 -06:00
parent 633885b57a
commit bcc64f6533
4 changed files with 142 additions and 1 deletions

View File

@@ -59,6 +59,13 @@ export const updateAgentSchema = createAgentSchema
export type UpdateAgent = z.infer<typeof updateAgentSchema>;
export const updateAgentInstructionsPathSchema = z.object({
path: z.string().trim().min(1).nullable(),
adapterConfigKey: z.string().trim().min(1).optional(),
});
export type UpdateAgentInstructionsPath = z.infer<typeof updateAgentInstructionsPathSchema>;
export const createAgentKeySchema = z.object({
name: z.string().min(1).default("default"),
});

View File

@@ -9,6 +9,7 @@ export {
createAgentSchema,
createAgentHireSchema,
updateAgentSchema,
updateAgentInstructionsPathSchema,
createAgentKeySchema,
wakeAgentSchema,
resetAgentSessionSchema,
@@ -18,6 +19,7 @@ export {
type CreateAgent,
type CreateAgentHire,
type UpdateAgent,
type UpdateAgentInstructionsPath,
type CreateAgentKey,
type WakeAgent,
type ResetAgentSession,