AgentDock is an original, open-source, self-hostable control plane for AI coding agents. It is not an LLM agent. It wraps agents such as Claude Code, Codex, Gemini CLI, OpenHands, LangGraph agents, OpenAI Agents SDK agents, or custom scripts with durable human approvals, task queues, artifacts, policy enforcement, realtime updates, and an append-only audit timeline.
- TypeScript monorepo with pnpm workspaces.
apps/web: Next.js + React + Tailwind accessible UI.apps/api: Fastify API with cookie auth, RBAC, rate limiting, CORS, SSE realtime, policy evaluation, and agent tool endpoints.packages/db: Prisma schema for PostgreSQL and seed data.packages/shared: Zod schemas, shared types, policy evaluator, redaction, approval state machine.packages/mcp-server: HTTP JSON-RPC MCP proxy exposing AgentDock tools to agents.examples/mock-agent: local script that creates a task, requests approval, polls a decision, uploads an artifact, and completes the task.
cd agentdock
cp .env.example .env
pnpm install
pnpm db:generate
pnpm db:push
pnpm db:seed
pnpm devOpen:
- Web: http://localhost:3000
- API health: http://localhost:4000/health
- MCP proxy health: run
pnpm dev:mcp, then http://localhost:4010/health
Demo login after seeding:
demo@agentdock.local
password123!
cd agentdock
docker compose up --buildCompose starts Postgres, the API, and the web app. The API container runs db:push and db:seed for local MVP convenience.
Prisma schema lives at packages/db/prisma/schema.prisma.
pnpm db:generate # generate Prisma client
pnpm db:push # local development sync
pnpm db:migrate # create/apply reviewed migrations
pnpm db:seed # demo user, workspace, policies, agent, tasks, approvalAn initial SQL migration is included under packages/db/prisma/migrations for review.
- Sign in to the web UI.
- Open the demo workspace.
- Go to Agents.
- Create an agent or rotate an existing token.
- Copy the token immediately. AgentDock stores only a hash and cannot show it again.
Agent calls must use:
Authorization: Bearer adk_...Query-string bearer tokens are disabled by default. ALLOW_QUERY_AGENT_TOKEN=true exists only for limited MCP clients and is not recommended.
# create or rotate an agent token in the web UI first
AGENTDOCK_AGENT_TOKEN=adk_... pnpm --filter agentdock-mock-agent devThe mock agent will:
- Create a task.
- Request approval for a fake dangerous shell command.
- Poll for the human decision.
- Upload a test log artifact.
- Mark the task completed, or stop after rejection.
Start the API and MCP proxy:
pnpm dev:api
pnpm dev:mcpUse examples/mcp-config/.mcp.json.example and provide the token through an environment variable or client secret store:
{
"mcpServers": {
"agentdock": {
"url": "http://localhost:4010/mcp",
"headers": {
"Authorization": "Bearer ${AGENTDOCK_AGENT_TOKEN}"
}
}
}
}MCP tools exposed:
getWorkspaceContext()createTask(...)updateTaskStatus(...)replyToTask(...)requestApproval(...)getApprovalDecision(...)reportProgress(...)addArtifact(...)getNextTask()logEvent(...)
All tool inputs are validated with Zod by the API, scoped to the authenticated agent workspace, and recorded as audit events.
- Agent calls
requestApprovalwith action details. - API evaluates enabled workspace policies.
- Denied actions return immediately and write an audit event.
- Required approvals create a pending
ApprovalRequestand realtime event. - Humans review the full proposed command/tool call/file paths/diff stats in the dashboard.
- Humans approve, reject, edit, ask for a plan, or escalate.
- The decision is durably stored with actor, timestamp, reason, and optional edited arguments.
- Agents poll
getApprovalDecisionor subscribe to workspace realtime events.
- Database is the system of record; realtime channels only deliver copies of durable events.
- Every important state transition writes an append-only
AuditEvent. - Agents are scoped to workspaces and authenticated with hashed bearer tokens.
- Raw agent tokens are visible only once and are never logged intentionally.
- Passwords are hashed with bcrypt.
- Minimal RBAC is implemented from the start: owner, admin, reviewer, operator, viewer.
- Auth uses signed HTTP-only cookies for humans.
- Agent tokens must be sent in
Authorization: Bearerheaders. - Integration configs are designed to be encrypted with AES-GCM utilities before storage.
- CORS allowlist and rate limiting are enabled.
- All request bodies and MCP tool inputs are validated with Zod.
See SECURITY.md for threat model and hardening guidance.
pnpm test # unit tests; DB integration tests are skipped unless enabled
RUN_DB_TESTS=true pnpm test:integration
pnpm e2e # requires seeded DB plus running API/webCovered units include policy evaluation, token hashing, RBAC checks, approval state transitions, and Zod validation. Integration tests cover workspace creation, agent token creation, task creation, approval request/approve/reject, denied policy rules, and revoked token blocking.
- This is an MVP, not a hardened multi-tenant SaaS.
- Invite flows and external integrations are stubbed.
- Agent session creation adapters are minimal; tasks/approvals/artifacts are complete enough for the happy path.
- File uploads use text/file URL fields; object storage can be added later.
- The MCP package is a lightweight HTTP JSON-RPC proxy for AgentDock tools.
- Slack integration
- Discord integration
- GitHub PR integration
- Linear/Jira import
- worktree manager
- Docker sandbox runner
- remote daemon
- OpenAI Agents SDK adapter
- LangGraph interrupt adapter
- OpenHands backend adapter
- mobile push
- multi-reviewer quorum approvals
- signed/tamper-evident audit logs
- OIDC/SAML
- team invites
- policy marketplace
- agent performance analytics