joe

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0

README

Joe

Joe (Joe Operates Everything): a self-hosted, open-source AI agent for infrastructure operations. Single Go binary with embedded web UI (go:embed), MCP server, SQLite persistence. Every action — from every surface — passes one governed executor.

Why Joe exists — read the launch essay: Announcing Joe, and why I was the safety layer


What Joe does

  • Understand live infrastructure. Ask Joe about your systems in natural language. Joe queries your clusters, cloud accounts, observability backends, and datastores through registered components, and builds a graph of how they relate.
  • Make changes with full context and governance. Joe reasons over live state and its knowledge store before acting, and every action it takes is classified and gated. Nothing runs outside the governed executor.
  • Ground your coding agent. Run joe mcp and Joe exposes its governed read tools over the Model Context Protocol, so Claude Code, Cursor, or any MCP client can pull real infrastructure context into a coding session.

Governed by construction

Joe's safety posture is resolved at boot and enforced on one path.

  • Observation is the default. An unconfigured Joe (JOE_MODE unset) boots with the write floor up and runs read-only. JOE_MODE=full is refused at boot as not yet implemented; any unrecognized value is refused fail-closed (internal/env).
  • The write floor is boot-resolved and runtime-immutable. Once Joe is up, nothing in the process lowers the floor. Recovery is a restart, never a live down-transition.
  • Actions are classified Read or Mutate. Every tool carries a binary classification authored in code. Reads pass the floor unconditionally; Mutates are denied by default. An unrecognized tool name is treated as a Mutate and denied — fail-closed. There are no other action classes.
  • Denial precedence is fixed: write floor, then the incident gate, then RBAC.
  • One governance seam. The web UI, the MCP server, and the REST API all converge on the same governed executor — the policy is identical no matter which surface issued the request.
  • No shell-out. Joe's shared diagnostic tools are Go-native and depend on no external CLI.
  • MCP is server-only. Joe runs as an MCP server but is deliberately not an MCP client: it does not consume external MCP servers' tools, because that protocol carries no enforceable action classification.
  • Kill switch. joe panic, SIGUSR1 to the server process, or POST /api/v1/panic puts Joe into safe mode, which restricts it to reads. joe unlock --reason "..." clears the panic state; the change takes effect on restart.

See docs/reference/security-in-layers.md for the full model.


Quick start

Prerequisites

  • Go 1.25 or later
  • Node.js 20+ and npm (to build the web UI)
  • One LLM API key — Anthropic or Google

Build

git clone https://github.com/jaimegago/joe.git
cd joe
make build

make build builds the production web UI with Vite, stages it into the embed directory, and compiles the joe binary with the UI embedded and build-truth injected via ldflags -X. A plain go build ./... compiles too, but produces a binary with the unset dev build defaults and without the packaged UI.

Configure the LLM

Set exactly one provider key in the environment that runs joe:

export ANTHROPIC_API_KEY="..."   # Claude
# — or —
export GEMINI_API_KEY="..."      # Gemini (GOOGLE_API_KEY also works)

If both keys are present, Joe defaults to Claude. Override the choice with JOE_LLM_PROVIDER=claude|gemini and, optionally, JOE_LLM_MODEL=<model-name>. If no supported key is set, Joe exits at boot with an actionable message.

See docs/configuration.md for the full configuration reference.

Run

./joe

Joe starts the daemon and logs the model it selected.


Interfaces

Bare joe (or joe --config ...) starts the server. Subcommands dispatch ahead of it:

joe mcp        Run Joe as an MCP stdio server
joe slack      Run Joe as a Slack bot (Socket Mode)
joe skills     Manage Agent Skills
joe incident   Declare, resolve, or inspect the incident regime
joe db         Operate on Joe's database file (backup, restore)
joe admin      Bootstrap the first admin on a database that has none
joe panic      Trigger an emergency shutdown
joe unlock     Clear the panic state (takes effect on restart)
  • Web UI — the embedded browser app for chat, the infrastructure graph, dashboards, and the admin panel.
  • joe mcp — an MCP stdio server exposing Joe's governed read tools to MCP clients; reads JOE_SERVER and JOE_API_KEY.
  • REST API — the HTTP surface on :7777 that every client, including the web UI, calls.
  • Slackjoe slack connects over Socket Mode (no public URL required), reading SLACK_BOT_TOKEN and SLACK_APP_TOKEN.

Access control

Write RBAC. Components are assigned to zones, and principals are granted access to zones. A mutate is allowed only when the caller's grants permit it and the write floor is down — the write floor and write-RBAC govern mutates independently of any read setting.

Read posture. A single install-wide scalar selects the human-facing read decision. The launch default is team_flat: every authenticated principal may read every component. The opt-in zoned posture makes reads grant-gated instead. Flipping the posture is an admin-gated, audited operator action.

Admin surface. Every handler under /api/v1/admin/ is admin-gated and writes an audit row — both properties are pinned by structural guard tests, so an admin endpoint added without a gate or without an audit write fails the build.

See docs/reference/security-in-layers.md for the security model.


Skills

Joe loads Agent Skills — portable folders that encode how a senior engineer frames a class of situation. Installed skills follow a quarantine-then-approve lifecycle: a newly installed skill lands quarantined and must be explicitly approved before Joe will load it. Skills do not bypass governance — a skill's suggested action still passes the same classified executor as any other tool.

joe skills install <repo-url> [--ref <branch|tag>] [--subdir <path>]
joe skills list
joe skills remove <skill-name> [--force]
joe skills update [<skill-name>]
joe skills approve <skill-name>
joe skills reject <skill-name>
joe skills reload

See docs/reference/joe-skills-design.md for the design.


Components

Joe connects to your infrastructure through components. A component reaches its live, credentialed state in two governed steps.

Register a component — credential-less by construction:

curl -X POST http://localhost:7777/api/v1/components \
  -H "Authorization: Bearer $JOE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "prod-cluster",
    "type": "kubernetes",
    "name": "Production Cluster"
  }'

Registration lands the component inert: it has no credential and cannot authenticate.

Promote it — the single governed transition that arms a component with a credential reference — via the admin-gated POST /api/v1/components/{id}/promote. Promotion writes a credential reference, never an inline secret. For a Kubernetes component the credential model is the API server URL (api_server), an inline CA bundle (ca_data), and an auth method (auth_method) — there is no kubeconfig path anywhere.

For the set of supported adapters, see internal/adapters/. For setup walkthroughs, see docs/integrations.md.


Knowledge store

Joe's knowledge store holds three kinds of entry:

  • Curated — human-owned knowledge. Immutable through the API.
  • Synced — entries pulled from an external source.
  • Derived — knowledge Joe extracts from its own operation. Mutable.

The curated/synced/derived distinction is a property of the knowledge store, separate from the infrastructure graph. See docs/configuration.md.


Development and testing

go build ./...   # compile
go test ./...    # tests
go vet ./...     # vet
gofmt -s -w .    # format

make build produces the release-shaped binary (embedded UI + injected build truth). Integration tests run under a build tag: go test -tags=integration ./....

See CLAUDE.md for repo conventions and test/README.md for the test tree layout.


Contributing

Contributions are welcome — see CONTRIBUTING.md for the development setup, testing expectations, and the safety invariants a PR must not violate.


Documentation

Doc What it covers
docs/configuration.md Config file reference and environment variables
docs/operations.md Running Joe, safety controls, and RBAC administration
docs/integrations.md Registering components, the MCP server, and the Slack bot
docs/web-ui.md Web UI specification
docs/reference/joe-architecture.md Full architecture and component diagrams
docs/reference/security-in-layers.md Security authority: action model, write floor, RBAC, read posture, panic mode
docs/reference/joe-skills-design.md Skills system design
docs/reference/observability.md OpenTelemetry instrumentation

Published documentation lives at joeagent.dev.


License

Joe is licensed under the Apache License 2.0 — see LICENSE. It is distributed as published release binaries — archives plus a checksums file, attached to a GitHub Release — and as source you can build yourself. There is no signing, installer, or package-manager tooling.

Directories

Path Synopsis
cmd
joe command
internal
access
Package access is the single guarded seam through which all infrastructure-adapter and graph-store access must flow.
Package access is the single guarded seam through which all infrastructure-adapter and graph-store access must flow.
adapters/github
Package github provides a GitHub adapter for PR read/comment operations.
Package github provides a GitHub adapter for PR read/comment operations.
adapters/gitlab
Package gitlab provides a GitLab adapter for MR read/comment operations.
Package gitlab provides a GitLab adapter for MR read/comment operations.
adapters/registry/artifactory
Package artifactory provides an adapter for JFrog Artifactory.
Package artifactory provides an adapter for JFrog Artifactory.
adapters/registry/ecr
Package ecr provides an adapter for AWS Elastic Container Registry (ECR).
Package ecr provides an adapter for AWS Elastic Container Registry (ECR).
adapters/registry/oci
Package oci provides an adapter for OCI Distribution Spec v2 compatible registries.
Package oci provides an adapter for OCI Distribution Spec v2 compatible registries.
agentctx
Package agentctx carries the session/run/idempotency-key request context that joe's HTTP middleware (api.SessionMiddleware) reads from request headers and the durable executor wrapper (coreagent.DurableExecutor) consumes when persisting tool-call intent.
Package agentctx carries the session/run/idempotency-key request context that joe's HTTP middleware (api.SessionMiddleware) reads from request headers and the durable executor wrapper (coreagent.DurableExecutor) consumes when persisting tool-call intent.
api
audit
Package audit is the append-only audit trail.
Package audit is the append-only audit trail.
auth
Package auth implements human authentication at the edge (Identity Phase C, docs/reference/joe-identity-design.md §2.1–§2.3, §2.9).
Package auth implements human authentication at the edge (Identity Phase C, docs/reference/joe-identity-design.md §2.1–§2.3, §2.9).
buildinfo
Package buildinfo is the single source of build truth for the joe binary.
Package buildinfo is the single source of build truth for the joe binary.
captaingate
Package captaingate is the SHARED tool-executor wrapper that enforces the §C captain-session mutation gate (and the §B1 principal substitution) on every agentic tool call — joe's Core-Agent loop (onboarding/refresh) AND the user task loop (`agentloop.Agent.Run` behind /api/v1/tasks and /api/v1/tasks/stream).
Package captaingate is the SHARED tool-executor wrapper that enforces the §C captain-session mutation gate (and the §B1 principal substitution) on every agentic tool call — joe's Core-Agent loop (onboarding/refresh) AND the user task loop (`agentloop.Agent.Run` behind /api/v1/tasks and /api/v1/tasks/stream).
componentgov
Package componentgov holds the governed-registration rules that make component CREATE/DELETE and the register_component LLM tool a single, consistent surface (A003 Stream G).
Package componentgov holds the governed-registration rules that make component CREATE/DELETE and the register_component LLM tool a single, consistent surface (A003 Stream G).
credential
Package credential implements the credential-provider abstraction from D-0026 (docs/project/adr/D-0026-credential-provider-abstraction.md).
Package credential implements the credential-provider abstraction from D-0026 (docs/project/adr/D-0026-credential-provider-abstraction.md).
crypto
Package crypto provides AES-256-GCM encryption for sensitive data at rest.
Package crypto provides AES-256-GCM encryption for sensitive data at rest.
env
findings
Package findings owns the §A4 cross-session attribution record: attributed, non-actionable synthesis messages a human posts into a target session's timeline.
Package findings owns the §A4 cross-session attribution record: attributed, non-actionable synthesis messages a human posts into a target session's timeline.
llm
llm/openaicompat
Package openaicompat implements the llm.LLMAdapter interface against any server that speaks the OpenAI Chat Completions wire protocol — OpenAI itself, but also vLLM, llama.cpp, Ollama, LocalAI, text-generation-webui, and similar projects that expose /v1/chat/completions and /v1/embeddings.
Package openaicompat implements the llm.LLMAdapter interface against any server that speaks the OpenAI Chat Completions wire protocol — OpenAI itself, but also vLLM, llama.cpp, Ollama, LocalAI, text-generation-webui, and similar projects that expose /v1/chat/completions and /v1/embeddings.
llmsettings
Package llmsettings owns the durable, operator-tunable controls for the LLM call path: the active model (singleton llm_settings table), the per-window cost thresholds (llm_cost_limits, three rows keyed by window name), and the session-lifetime token ceiling (singleton llm_runaway_limits).
Package llmsettings owns the durable, operator-tunable controls for the LLM call path: the active model (singleton llm_settings table), the per-window cost thresholds (llm_cost_limits, three rows keyed by window name), and the session-lifetime token ceiling (singleton llm_runaway_limits).
llmusage
Package llmusage records one llm_usage row per Chat call.
Package llmusage records one llm_usage row per Chat call.
mcp
Package mcp implements a Model Context Protocol server that exposes Joe's infrastructure intelligence to MCP clients such as Claude Code, Cursor, and Codex.
Package mcp implements a Model Context Protocol server that exposes Joe's infrastructure intelligence to MCP clients such as Claude Code, Cursor, and Codex.
promotereads
Package promotereads owns the durable per-component-type auto_promote_reads flag (A001-COREGOV CC-04) and its single audited write path.
Package promotereads owns the durable per-component-type auto_promote_reads flag (A001-COREGOV CC-04) and its single audited write path.
prompts
Package prompts centralises all LLM system-prompt text and error-message templates used across Joe.
Package prompts centralises all LLM system-prompt text and error-message templates used across Joe.
rbac
Package rbac implements role-based access control for joecored.
Package rbac implements role-based access control for joecored.
readposture
Package readposture owns the durable install-wide read posture (read-posture-latch) and its single audited write path.
Package readposture owns the durable install-wide read posture (read-posture-latch) and its single audited write path.
runmodel
Package runmodel owns the durable run substrate defined in the session-model design (Phase 0) §D: runs, steps, solicitations, world handles, idempotency keys, and the action ledger.
Package runmodel owns the durable run substrate defined in the session-model design (Phase 0) §D: runs, steps, solicitations, world handles, idempotency keys, and the action ledger.
seams
Package seams hosts the compile-time autonomy-seam flags from the session-model design (Phase 0) §"incremental-autonomy seam pattern".
Package seams hosts the compile-time autonomy-seam flags from the session-model design (Phase 0) §"incremental-autonomy seam pattern".
search
Package search provides Joe's web-search capability: a SearchProvider abstraction plus a boot-time factory that selects a provider implementation from configuration.
Package search provides Joe's web-search capability: a SearchProvider abstraction plus a boot-time factory that selects a provider implementation from configuration.
sessionarchive
Package sessionarchive implements the §12.6 archive backend behind a provider seam (DESIGN-CHAT-SESSIONS.md §12.6, ledger node B007 — the archive half, built in the B007c split node).
Package sessionarchive implements the §12.6 archive backend behind a provider seam (DESIGN-CHAT-SESSIONS.md §12.6, ledger node B007 — the archive half, built in the B007c split node).
sessionauthz
Package sessionauthz is the dedicated, single-decision-per-resource-class authorization seam for sessions (DESIGN-CHAT-SESSIONS.md §12.7, ledger node B003).
Package sessionauthz is the dedicated, single-decision-per-resource-class authorization seam for sessions (DESIGN-CHAT-SESSIONS.md §12.7, ledger node B003).
sessiongate
Package sessiongate implements the §C captain-session-owned mutation gate as a pure function.
Package sessiongate implements the §C captain-session-owned mutation gate as a pure function.
sessionmodel
Package sessionmodel owns the durable session, system regime, and captain binding records defined in the session-model design (Phase 0) (§5b, §B, §R).
Package sessionmodel owns the durable session, system regime, and captain binding records defined in the session-model design (Phase 0) (§5b, §B, §R).
sessionsweeper
Package sessionsweeper implements the §12.5 retention sweeper: the single automated expiration driver for the redesigned session subsystem (DESIGN-CHAT-SESSIONS.md §12.5, ledger node B007).
Package sessionsweeper implements the §12.5 retention sweeper: the single automated expiration driver for the redesigned session subsystem (DESIGN-CHAT-SESSIONS.md §12.5, ledger node B007).
skills
Package skills implements Joe's Agent Skills consumer.
Package skills implements Joe's Agent Skills consumer.
slack
Package slack implements the Joe Slack bot server.
Package slack implements the Joe Slack bot server.
sqlutil
Package sqlutil provides database driver utilities shared across packages that cannot import internal/store without creating import cycles.
Package sqlutil provides database driver utilities shared across packages that cannot import internal/store without creating import cycles.
tools/core
Package core's CoreToolsClient is the aggregate of every small *Client interface the core tools depend on.
Package core's CoreToolsClient is the aggregate of every small *Client interface the core tools depend on.
tools/shared/dnsquery
Package dnsquery provides a Go-native DNS lookup tool.
Package dnsquery provides a Go-native DNS lookup tool.
tools/shared/httpreq
Package httpreq provides a Go-native HTTP probing tool.
Package httpreq provides a Go-native HTTP probing tool.
tools/shared/netcheck
Package netcheck provides Go-native TCP connectivity checking tools.
Package netcheck provides Go-native TCP connectivity checking tools.
tools/shared/traceroute
Package traceroute provides a Go-native network path tracing tool.
Package traceroute provides a Go-native network path tracing tool.
tools/shared/websearch
Package websearch provides the web_search shared tool: a Go-native, Read-class tool that queries a configured search backend and returns ranked results (title, url, snippet).
Package websearch provides the web_search shared tool: a Go-native, Read-class tool that queries a configured search backend and returns ranked results (title, url, snippet).
uid
warnings
Package warnings owns the §E Joe-warnings surface — Joe's append-only, attributed, human-reviewable list of incident-judgments-it-is-not- authorized-to-act-on (§E1, §R3).
Package warnings owns the §E Joe-warnings surface — Joe's append-only, attributed, human-reviewable list of incident-judgments-it-is-not- authorized-to-act-on (§E1, §R3).
webui
Package webui serves the embedded single-page web UI for joe.
Package webui serves the embedded single-page web UI for joe.
scripts
verify-ui-digest command
Command verify-ui-digest prints the canonical buildinfo.Compute sha256 digest for a UI dist directory, so CI can compare a booted binary's reported ui_digest (GET /api/v1/version) against a digest computed independently over the files it was staged from — proving the embed matches the staged build rather than the committed placeholder.
Command verify-ui-digest prints the canonical buildinfo.Compute sha256 digest for a UI dist directory, so CI can compare a booted binary's reported ui_digest (GET /api/v1/version) against a digest computed independently over the files it was staged from — proving the embed matches the staged build rather than the committed placeholder.
test
mocks
Package mocks provides mock implementations for testing
Package mocks provides mock implementations for testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL