paperclipai/paperclip · error

Existing Anthropic Agent enables or omits the locked tools,

Error message

Existing Anthropic Agent enables or omits the locked tools, MCP, skills, or multi-agent profile

What it means

`assertSafeManagedAgent` verifies an existing Anthropic Agent matches Paperclip's locked profile: not archived, exact CLAUDE_MANAGED_SYSTEM_PROMPT, a non-empty model string, and empty `tools`, `mcp_servers`, and `skills` arrays with `multiagent` unset. Any deviation throws this error. It guarantees Paperclip only drives agents whose capabilities are fully locked down to session-supplied tools.

Source

Thrown at cli/src/commands/managed-agent.ts:212

  }
}

export function assertSafeManagedAgent(agent: Record<string, unknown>): void {
  const model = typeof agent.model === "string" ? agent.model : record(agent.model).id;
  if (
    agent.archived_at !== null
    || agent.system !== CLAUDE_MANAGED_SYSTEM_PROMPT
    || typeof model !== "string"
    || !model
    || !Array.isArray(agent.tools)
    || agent.tools.length > 0
    || !Array.isArray(agent.mcp_servers)
    || agent.mcp_servers.length > 0
    || !Array.isArray(agent.skills)
    || agent.skills.length > 0
    || agent.multiagent != null
  ) {
    throw new Error(
      "Existing Anthropic Agent enables or omits the locked tools, MCP, skills, or multi-agent profile",
    );
  }
}

async function resolveEnvironment(
  key: string,
  options: ManagedAgentSetupOptions,
): Promise<Record<string, unknown>> {
  if (options.environmentId) {
    const environment = await anthropicRequest(
      key,
      "GET",
      `/v1/environments/${encodeURIComponent(options.environmentId)}`,
    );
    assertSafeManagedEnvironment(environment);
    return environment;
  }

View on GitHub (pinned to 5716fe907e)

Solutions

  1. Omit --agent-id and let Paperclip create/resolve a conforming agent automatically
  2. Revert the agent: restore the exact Paperclip system prompt, empty tools/mcp_servers/skills arrays, remove multiagent, unarchive, and keep the qualified model
  3. Delete the modified agent and run setup fresh so Paperclip provisions a new one
  4. Diff the agent JSON (GET /v1/agents/:id) against the locked profile to find which field trips the assertion

Example fix

// before
--agent-id agent_hand_modified  // has tools=[{...}], skills=["web"]
// after (let Paperclip resolve/create)
paperclip managed-agent setup ... # no --agent-id
// or fix the agent:
{"system":"<CLAUDE_MANAGED_SYSTEM_PROMPT>","tools":[],"mcp_servers":[],"skills":[],"multiagent":null,"archived_at":null}
Defensive patterns

Strategy: type-guard

Validate before calling

// Fetch and check before passing --agent-id:
const agent = await getAgent(key, agentId);
const bad = agent.archived_at !== null || agent.tools?.length || agent.mcp_servers?.length
  || agent.skills?.length || agent.multiagent != null || agent.system !== CLAUDE_MANAGED_SYSTEM_PROMPT;
if (bad) throw new Error("Agent does not match the locked tools/MCP/skills/multiagent profile");

Type guard

function isSafeAgent(agent: Record<string, unknown>): boolean {
  const model = typeof agent.model === "string" ? agent.model : (agent.model as any)?.id;
  return agent.archived_at === null && agent.system === CLAUDE_MANAGED_SYSTEM_PROMPT
    && typeof model === "string" && model.length > 0
    && Array.isArray(agent.tools) && agent.tools.length === 0
    && Array.isArray(agent.mcp_servers) && agent.mcp_servers.length === 0
    && Array.isArray(agent.skills) && agent.skills.length === 0
    && agent.multiagent == null;
}

Try / catch

try {
  await setupManagedAgent(opts);
} catch (err) {
  if (err instanceof Error && err.message.includes("locked tools, MCP, skills")) {
    console.error("Agent drifted from the locked profile — recreate via Paperclip or revert its definition"); process.exitCode = 2;
  } else throw err;
}

Prevention

When it happens

Trigger: Passing --agent-id pointing at an agent you edited in the Anthropic console to add tools, MCP servers, skills, or multi-agent config; an agent with a modified system prompt or different model; adopting a pre-existing general-purpose agent; an archived agent being reused; a beta API schema change altering defaults so fields no longer serialize as empty arrays or null.

Common situations: Tinkering with the agent definition to test a tool, then the next Paperclip run rejects it; pointing the CLI at an agent created outside Paperclip; version drift where the recorded CLAUDE_MANAGED_SYSTEM_PROMPT no longer matches a prompt edited remotely.

Related errors


AI-assisted analysis of paperclipai/paperclip@5716fe907e (2026-09-02). Data as JSON: /api/errors/f55e56c4f8b86be7. Report an issue: GitHub.