doc/plans/2026-02-18-agent-authentication-implementation.md
claude_local, codex_local.sub (agent id)company_idadapter_typerun_idiatexpjti (run token id)PAPERCLIP_AGENT_JWT_SECRETPAPERCLIP_AGENT_JWT_TTL_SECONDS (default: 172800)PAPERCLIP_AGENT_JWT_ISSUER (default: paperclip)PAPERCLIP_AGENT_JWT_AUDIENCE (default: paperclip-api)actorMiddlewareagent_api_keys hash lookup).server/src/middleware/auth.ts.req.actor = { type: "agent", agentId, companyId }.ServerAdapterModule (likely packages/adapter-utils/src/types.ts) with a capability flag:
supportsLocalAgentJwt?: true.server/src/adapters/registry.ts for claude_local and codex_local.process/http adapters unset for P0.server/src/services/heartbeat.ts, when adapter supports JWT:
In:
packages/adapters/claude-local/src/server/execute.tspackages/adapters/codex-local/src/server/execute.tsinject PAPERCLIP_API_KEY from context token.
adapterConfig.env:
PAPERCLIP_API_KEY, do not overwrite it.PAPERCLIP_AGENT_IDPAPERCLIP_COMPANY_IDPAPERCLIP_API_URLskills/paperclip/SKILL.mdcli/src/commands/heartbeat-run.ts output/help examples if they mention manual API key setup.PAPERCLIP_API_KEY config.agent_api_keys) still work unchanged.req.actor.companyId used by existing checks).claude_local, codex_local) while adapter capability model is generic.