Kitsuden ES
Open source · beta 0.9.0

Your agent gets a key, not the database password.

Kitsuden is an open-source backend for apps that AI agents use. Declare a model once and you get the API, the MCP tools and the admin panel, with permissions, an audit log and your sign-off on anything risky.

Use my coding agent instead

For people who build with Claude Code, Cursor or Codex and want their agent to touch real data safely. Needs Docker. MIT licensed. Follow the 70-second tutorial.

Your agent

    Kitsuden

    • ·Key
    • ·Scope
    • ·Row security
    • ·Sign-off

    You

      Interactive tutorial · 71 seconds

      Learn it in six steps. The page plays along.

      The list follows the film: the step on screen lights up and its command is ready to copy. Click a step to jump to it, or turn on step mode and the film stops after each one, so you can do it yourself before you go on.

      1. One command clones the repository and runs the installer. It writes every secret, builds the images on your machine and prints the panel URL with a one-time setup token. Needs Docker.

        git clone https://github.com/Kitsuden/kitsuden.git && cd kitsuden && ./install.sh
      2. One file says what a note is and who may touch it. You get a REST API, MCP tools, an admin form and a typed SDK method. The access rule is required and reaches PostgreSQL row-level security.

        pnpm kitsuden make kon notes && pnpm kitsuden make model note --kon notes
        More on models ↓
      3. In the panel at http://localhost:3001, open Agents, create one and pick only the scopes it needs. It gets its own kitsuden_agent_… key and rate limit; revoke it without touching the others.

      4. Copy docs/agents/kitsuden.mcp.json to .mcp.json. The key reaches the server from the environment, so it is never written in the repository.

        export KITSUDEN_API_URL=http://localhost:3000 KITSUDEN_API_TOKEN=kitsuden_agent_…
        Set-up for Claude Code, Codex and Antigravity
      5. Key, scope, policy and row-level security, then the audit log. Outside its scopes the agent gets a 403 with a stable code and a hint it can act on.

        See all six defaults ↓
      6. Switch approvals on and an agent's DELETE becomes a proposal (202) with a diff in your inbox. Approved, it runs once with the agent's own permissions.

        Try it live in the demo above ↑

      Write the model. The rest is generated.

      One file says what a note is and who may touch it. Kitsuden turns it into everything an app and an agent need, and the access rule goes all the way down to the database.

      export const note = defineModel({
        name: "note",
        description: "A personal note. Each account sees only its own.",
        fields: {
          title: field.text({ max: 200, required: true }),
          body: field.longText(),
          pinned: field.boolean({ required: true, defaultValue: false }),
        },
        access: { read: "owner", write: "owner" }, // required
      });

      Five routes, documented in OpenAPI 3.1 at /api/docs. Each account only gets its own rows.

      GET    /api/notes/notes
      POST   /api/notes/notes
      GET    /api/notes/notes/:id
      PATCH  /api/notes/notes/:id
      DELETE /api/notes/notes/:id

      The full walkthrough takes about five minutes: Your first model.

      The safe setting is the default one.

      You don't follow a hardening checklist. These are on from the first start, and the API refuses to run without some of them.

      Agents have their own identity
      Each agent gets a kitsuden_agent_… key with the scopes you pick and its own rate limit. Revoke one without touching the others.
      No rule means no
      An action with no policy is denied. Row-level security lives in PostgreSQL, and in production the API won't start on a connection that could skip it.
      Everything is written down
      Every agent authentication and action lands in an audit log you can read per agent in the panel.
      Risky actions can wait for you
      Switch approvals on and an agent's DELETE becomes a proposal (202) with a diff in your inbox. Approved ones run once.
      Errors an agent can act on
      Every error has a stable code, a hint and whether a retry makes sense. Retries with an Idempotency-Key never run twice.
      Agent-written code is sandboxed
      Code actions run in a WebAssembly interpreter with no files, sockets or secrets, and go through tests and review before they're active.

      Answers that cost fewer tokens.

      Agents pay for every character they read. Kitsuden can answer in TOON, where a list becomes a table, and its auto mode sends whichever format is shortest after checking it decodes to the same data.

      
                  
      
                  
      Compact JSON
      TOON

      This counts characters of the sample above. Measured on 24 real responses, auto used 16.7% fewer tokens than compact JSON: how it was measured.

      Need a blog, a CRM or payments? Add a kon.

      A kon is a feature you install with one command: its tables, API routes, MCP tools and permissions come together. There are 30, each one says how mature it is, and you only install the ones you want.

      pnpm kitsuden kon add blog --from ../kitsuden-kons

      Browse the kons

      Install it in one command.

      The installer writes every secret, builds the images on your machine and prints what to open. Everything stays on localhost.

      Paste this into Claude Code, Cursor or Codex, in the folder of the app you're building.

      Set up Kitsuden as the backend for this project.
      
      1. Clone https://github.com/Kitsuden/kitsuden next to this folder and run
         ./install.sh (on Windows: powershell -ExecutionPolicy Bypass -File install.ps1).
         It needs Docker running and takes 5 to 15 minutes the first time.
      2. When it finishes, give me the panel URL and the one-time setup token it
         printed, and wait while I create the administrator and an agent key.
      3. Read AGENTS.md and docs/agents/coding-agents.md in that repo, connect to
         its MCP server with the key I give you, and read GET /llms.txt before
         your first call. Never invent routes or scopes.
      4. Never ask me for the database password. Use only the agent key. If an
         answer is 202 KITSUDEN_E_APPROVAL_REQUIRED, tell me and do not retry.
      1. Create the administrator. Open the panel at http://localhost:3001 and enter the one-time setup token the installer shows.

      2. Create an agent. In the panel, go to Agents, choose New agent, pick its scopes and copy its key.

      3. Connect it. Point your MCP client at http://localhost:3000/api/mcp with that key. Setup for Claude Code, Codex and Antigravity.

      It's a beta. The first build takes 5 to 15 minutes and a few GB of RAM, because nothing is published to npm or a container registry yet. Kitsuden runs as a container next to PostgreSQL; it isn't made for edge or serverless runtimes.

      Questions people ask first

      Is this an agent framework?

      No. A framework decides what the agent does, and a queue decides when. Kitsuden is the backend the agent talks to: it decides whether the agent may do it, for whom, and who signs off. Use it with any framework or with none.

      Which agents work with it?

      Anything that speaks MCP or HTTP: Claude Code, Cursor, Codex, Antigravity, or your own code. Each one gets its own key.

      Does it build my website too?

      No, it's the backend. Your site or app is a separate project that reads the API. The repository includes a neutral Astro starter, and Inti adds editing on the page.

      What does it run on?

      Bun, Hono and Drizzle over PostgreSQL 16 with pgvector, and a SvelteKit admin panel. Two services are enough: the API and Postgres.

      Do approvals slow my agent down?

      Only where you ask for them. Approvals are off until you switch them on, and then they apply to the operations you mark as sensitive (every delete, by default) or to the agents you set to propose only.