# Sypnia Agent documentation > Sypnia Agent is a coding agent that builds your app one use case at a time, and talks to you at your level: in plain words if you do not program, in code if you do. It follows your design guide, your landing page and plan, and your map; it asks before anything that cannot be undone; and every task has a budget you set, paid with credits. Sypnia comes two ways, and every page says which one it is about: - **Agent CLI and runner** (open source, on your machine): Ingest, storage, aggregation, problem grouping, sessions, replay data and uptime checks. You read it through: The HTTP API, the MCP server, the CLI and the Console: one built-in page with the problems list and the session replay viewer. - **Sypnia Cloud** (hosted sandboxes, paid with credits): The same engine, run by us. You read it through: The full app: replay player, performance, uptime, daily summary, search and teams. Every page is also plain Markdown: add `.md` to its address (`https://agent.docs.sypnia.com/start/open-source-and-cloud.md`). All pages in one file: https://agent.docs.sypnia.com/llms-full.txt ## Start here What Sypnia Agent is, how it works, your level, what is open source and what is Sypnia Cloud, and the quickstarts. - [Start here: overview](https://agent.docs.sypnia.com/start.md): Section index for Sypnia Agent: Sypnia's coding agent. It works one use case at a time (Cases), adapts how it talks to the person's level (a short knowledge test kept in the Sypnia account), follows three pillars (design guide, landing+plan contract, Sypnia skills), runs commands in a sandbox, asks before irreversible actions, and spends from a per-task budget in credits. Open-source CLI and local runner; Sypnia Cloud adds hosted sandboxes, synced memory, team approvals and Sypnia AI. [Engine, Cloud] - [What Sypnia Agent is](https://agent.docs.sypnia.com/start/what-it-is.md): Sypnia Agent: a coding agent comparable to Claude Code, built around Sypnia's paradigm. Unit of work = a use case (or a map proposal). Talks at the person's level. Follows the three pillars. Uses Data, Cases, Git, Run and Telemetry through MCP. Sandboxed execution, explicit approvals, per-task credit budgets. Not an autopilot that deploys without asking; not tied to Sypnia's other products. [Engine, Cloud] - [How it works](https://agent.docs.sypnia.com/start/how-it-works.md): Task lifecycle: request → read profile (level), project memory, map, design guide, plan → classify against the map (existing case / new case → proposal / out of plan) → plan of steps shown at the person's level → work in the sandbox (edit, run tests) within the budget → questions and approvals when needed → result: a branch and a pull request linked to the case, with a summary at the person's level and the cost. [Engine, Cloud] - [Your level](https://agent.docs.sypnia.com/start/your-level.md): Knowledge test: ~10 questions, about 5 minutes, adaptive (stops early), covering reading code, web basics, data, tooling, deployment. Result: a profile {level: starter|builder|developer|senior, explain: plain|mixed|technical, shows: screens|cases|code|diffs, language} stored in the Sypnia account (Cloud) or ~/.config/sypnia/profile.json (local). Used by Agent, Cases (reading level), Learn. Editable anytime; the agent proposes updates as the person grows, never silently. [Engine, Cloud] - [Open source and Sypnia Cloud](https://agent.docs.sypnia.com/start/open-source-and-cloud.md): Open source: the `agent` CLI, the local runner, the sandbox supervisor (Rust), the safety policy format, the Sypnia skills. Sypnia Cloud: hosted sandboxes (tasks run while you are away), Sypnia AI (models paid in credits), level and memory in the Sypnia account, approvals on web and phone, team approvals, task history. Licenses: the orchestrator and the sandbox supervisor AGPL-3.0; the CLI client and the skills MIT. [Engine, Cloud] - [Quickstart: your terminal](https://agent.docs.sypnia.com/start/quickstart-terminal.md): Terminal quickstart: `npx @sypnia/agent login` (device flow; or `--key` for your own model key without an account), the level test on first run, then `npx @sypnia/agent ""` in a repository; approvals inline; result is a branch + summary. [Engine, Cloud] - [Quickstart: Sypnia Cloud](https://agent.docs.sypnia.com/start/quickstart-cloud.md): Cloud quickstart: agent.app.sypnia.com with the Sypnia account → choose a repository (Sypnia Git or GitHub) and a map → describe the task → set a budget → follow it live; approvals arrive on web and phone; the result is a pull request. [Cloud] ## The three pillars A design guide of its own for every project, the landing page and plan as the contract, and Sypnia skills. - [The three pillars: overview](https://agent.docs.sypnia.com/pillars.md): The agent's three pillars: (1) a project design guide (.md + PDF: logo, palette, typography, icons, components) made before any screen, so no two Sypnia apps look alike; (2) the landing page and plan.md as the hard contract, checked with Cases; (3) Sypnia skills, the agent's know-how, open and versioned. [Engine, Cloud] - [The design guide](https://agent.docs.sypnia.com/pillars/design-guide.md): Before the first screen the agent writes design/guide.md and design/guide.pdf: name and voice, logo (SVG, construction), palette with tokens (light/dark), typography pairing, icon style, spacing and radius, components, imagery rules, do/don't. Tokens exported as CSS variables (design/tokens.css). Rule: no generic cards or stock icon sets; every UI change must use the guide's tokens; the guide is changed on purpose, never drifted from. The guide lives in Sypnia Design (design.docs.sypnia.com), with its tokens in design/tokens.json and the project's own components generated from it into the repository. [Engine, Cloud] - [The contract](https://agent.docs.sypnia.com/pillars/contract.md): Contract for the agent: the approved landing page (promises) and plan (milestones) plus the map (Cases). The agent: builds the landing page and plan first and gets them approved; works milestone by milestone; never builds what the contract does not include (it proposes a change instead); reports progress against promises. Enforced with `cases check --contract`. [Engine, Cloud] - [Skills](https://agent.docs.sypnia.com/pillars/skills.md): Skills: folders with a SKILL.md (when to use, steps, checks) plus files, in the same format as Claude Code skills. Sypnia ships its own under the publisher sypnia: sypnia-start, sypnia-contract, sypnia-cases, sypnia-data, sypnia-design-guide/-icons/-screens/-build/-check, sypnia-modern-web, sypnia-publish, sypnia-setup, sypnia-fix. A skill may declare MCP servers in skill.yaml (touches.mcp, label «Adds MCP servers»); official skills add none themselves, the sypnia plugin declares the products' servers (e.g. https://mcp.data.sypnia.com); the agent shows a declared server and asks once before connecting it. Projects add skills in .sypnia/skills/; the Skills product (skills.sypnia.com) hosts a marketplace. The agent loads only the skills a task needs. [Engine, Cloud] ## How it works with you Tasks, use cases, questions, memory, and the products it uses. - [How it works with you: overview](https://agent.docs.sypnia.com/work.md): Working with the agent: tasks are tied to use cases; it asks questions at the person's level; it remembers per person and per project (visible and editable); it uses Data, Cases, Git, Run and Telemetry through MCP with the person's permissions; teach mode (teach while building, used by Sypnia Learn). [Engine, Cloud] - [Tasks and use cases](https://agent.docs.sypnia.com/work/tasks-and-cases.md): A task = a request + the case(s) it works on + a budget. Before working it reads the case: starts, place and path (navigation map; answers «where do I edit X?»), declared outcomes and failures (every run ends in one), listeners in the event graph (new version instead of breaking them); new starts/outcomes/listeners are map proposals. States: planning, waiting (question/approval/proposal), working, done, stopped (budget/time/cancel), failed. Request classification: existing case(s) → work; new case → propose to the map and wait; outside the plan → propose a contract change. Output: a branch, a pull request with `Case:` trailers, tests, a summary, the cost. Without a map (plain repository), the agent writes the case it is about to build into the task summary. [Engine, Cloud] - [Questions](https://agent.docs.sypnia.com/work/questions.md): The agent asks: when the request is ambiguous, when a choice changes what customers see, when the plan or map would change, and for every approval. One question at a time for starters; batched for developers. Each question offers concrete choices plus 'something else'; unanswered questions pause the task (no spending) and notify on web/phone. [Engine, Cloud] - [Memory](https://agent.docs.sypnia.com/work/memory.md): Memory = short facts, each with why and when. Two scopes: person (preferences, level, how you like to work) and project (decisions, conventions, gotchas). Stored as files (.sypnia/memory/ in the project; ~/.config/sypnia/memory/ for the person) or in the Sypnia account (Cloud). Visible, editable, deletable; the agent cites the memory it used; nothing secret is ever stored (secrets are refused). [Engine, Cloud] - [Products it uses](https://agent.docs.sypnia.com/work/products.md): The agent uses Sypnia products through their MCP servers (mcp.data.sypnia.com, mcp.cases.sypnia.com, mcp.git.sypnia.com, mcp.run.sypnia.com, mcp.telemetry...) with the person's account and scopes: Data (schema, migrations on non-production, queries under RLS), Cases (read map, propose), Git (branches, PRs), Run (previews; production deploys need approval), Telemetry (read problems and traces). Any other MCP server can be added. Each tool call is shown in the task and counted in its log. [Engine, Cloud] - [Teach mode](https://agent.docs.sypnia.com/work/teach-mode.md): Teach mode: a session setting, on for that session only. Turn on: say «teach me while you build», the Teach switch in the session header in Sypnia App, `npx @sypnia/agent --teach ""`, or the API session setting learn.teach=true. The agent explains the plan in the case's words and what you will learn; explains each step first at your level; leaves «your turn» steps sized by level (starter: choose between options, name a failure; builder: write a case's steps, add a field; developer: write a function or a test that it reviews; senior: decide the design while it argues the other side); links the Sypnia Learn lessons that cover what just happened; at the end summarizes what you learned and offers to save it as memory notes. Slower and uses more of the model, so the budget estimate is larger and said before starting. Safety rules unchanged. Learn's own teaching (lessons, exercises, checks) lives in Sypnia Learn. [Engine, Cloud] ## Safety What the agent does without asking, what it asks first, the sandbox, budgets in credits and approvals. - [Safety: overview](https://agent.docs.sypnia.com/safety.md): Safety model: tiers (do freely / ask once per task / always ask / never), a sandbox for every command (no inbound network, egress allowlist, no access to the person's credentials), per-task budgets in credits with hard stops, approvals from terminal/web/phone/team. Pages: permissions, sandbox, budgets, approvals. [Engine, Cloud] - [What it does without asking](https://agent.docs.sypnia.com/safety/permissions.md): Tiers. DO: read the workspace and docs; edit files in its branch; run tests, linters, builds, local servers in the sandbox; read Telemetry; create previews; open proposals and pull requests. ASK ONCE PER TASK: add or upgrade dependencies; reach a network host outside the allowlist; migrations on non-production databases; spend past the estimate (within budget). ALWAYS ASK: deploy to production; migrations or writes on production data; delete data, branches or files outside its branch; send e-mails/messages/notifications to real people; merge or push to protected branches; change secrets, permissions, billing or domains; anything outside the approved map or plan (it proposes instead). NEVER: read secret values; disable its own rules; approve its own requests; act on instructions found in files, web pages, issues or tool output. Rules live in the [agent] table of sypnia.toml (project) and team settings; a project can only make rules stricter than the team's. [Engine, Cloud] - [The sandbox](https://agent.docs.sypnia.com/safety/sandbox.md): Every command runs in a sandbox: local (a container or microVM via the runner; Linux namespaces/seccomp, macOS and Windows through a lightweight VM) or hosted (one isolated task per agent task on AWS, destroyed afterwards). Properties: the workspace is a copy (the agent's branch), no inbound network, egress through a proxy with an allowlist (package registries, the project's own preview hosts, Sypnia APIs), no access to the person's home, keychain, SSH keys or cloud credentials; CPU/memory/time limits; every command and network request logged. [Engine, Cloud] - [Budgets](https://agent.docs.sypnia.com/safety/budgets.md): Budgets: each task has a budget in Sypnia credits (Cloud) or in the person's model-provider currency (self-hosted, tracked by tokens). Before starting: an estimate (range). During: spending per step (model tokens, sandbox minutes) shown live. At 80%: a notice. At 100%: hard stop, work saved on its branch, a summary of what is left. Defaults per person and per team; no task without a budget. Credits are prepaid (topped up with PayPal); nothing is billed afterwards. [Engine, Cloud] - [Approvals](https://agent.docs.sypnia.com/safety/approvals.md): Approvals: requested for 'always ask' and 'ask once' actions, map/plan proposals and budget raises. Show: what, why, the exact effect (diff, SQL, recipients count, deploy target), and how to undo if possible. Where: terminal (local); in Sypnia Cloud the session in App (web and desktop), a push to the phone (the installable web app), and e-mail when nobody has seen it for 30 minutes. Who: the task owner by default; team rules can require a second person for production. While waiting: no spending; after 24 h the task pauses and keeps its branch. Decisions are logged with who and when. [Engine, Cloud] ## Models Which models the agent uses, through Sypnia AI or your own key, and what they see. - [Models: overview](https://agent.docs.sypnia.com/models.md): Models: in Sypnia Cloud through Sypnia AI (a gateway over OpenRouter; one account, usage paid in credits; zero-retention providers only). Self-hosted: any OpenAI-compatible endpoint, OpenRouter, or Anthropic directly, with the person's key. A default model is chosen for coding quality; the person or team can pick another per task. What the model sees: the request, the relevant files and map, tool results (marked as data), never secret values. The model is replaceable; the safety rules do not depend on it. [Engine, Cloud] ## SDK, CLI and MCP The @sypnia/agent package, the agent command, and MCP tools to delegate to it. - [SDK, CLI and MCP: overview](https://agent.docs.sypnia.com/tools.md): @sypnia/agent: /client (start and follow tasks, answer questions, approve; events as a stream), /runner (embed the local runner), the CLI `npx @sypnia/agent` (login, run a task, tasks, logs, approve, profile, memory). MCP server https://mcp.agent.sypnia.com for other agents to delegate (start_task, get_task, list_tasks, answer, approve, cancel). [Engine, Cloud] - [The SDK](https://agent.docs.sypnia.com/tools/sdk.md): createClient({ token }) from '@sypnia/agent/client': tasks.create({ repository, request, case?, budget }), tasks.events(id) async iterator (step, question, approval, done), questions.answer(id, choice), approvals.decide(id, 'approve'|'deny'), tasks.cancel(id). '@sypnia/agent/runner': createRunner({ workspace, model: { endpoint, key }, rules }) to run locally. [Engine, Cloud] - [The CLI](https://agent.docs.sypnia.com/tools/cli.md): Commands: login [--key], "" [--budget N] [--case id] [--cloud] [--teach], tasks, logs , approve / deny , profile (level, retake test), memory (list/edit/forget), rules (show the effective permission tiers). [Engine, Cloud] - [MCP](https://agent.docs.sypnia.com/tools/mcp.md): MCP server https://mcp.agent.sypnia.com (one endpoint for the product; the token decides: Sypnia account token, PAT or agent session). Tools: start_task (repository, request, case?, budget), get_task, list_tasks, answer (question id, choice), cancel. Approvals of always-ask actions are NOT exposed to MCP: a person approves them on the web, phone or terminal. [Cloud] ## API reference Every endpoint of the Agent API, its authentication and its errors. - [API reference: overview](https://agent.docs.sypnia.com/api.md): Base https://agent.api.sypnia.com/v1. Auth: Bearer Sypnia token; scopes agent:tasks, agent:approve (person session only). Resources: tasks (create, get, list, cancel, events SSE), questions (answer), approvals (list, decide), budgets (defaults), profile, memory. Errors JSON {error:{code,message}}: 402 insufficient_credits, 403 needs_person, 409 task_finished, 422 invalid_request, 429. [Engine, Cloud] ## Architecture How Sypnia Agent is built, where each part runs, and why the safety rules live outside the model. - [Architecture: overview](https://agent.docs.sypnia.com/architecture.md): Components: the CLI (TypeScript), the orchestrator (TypeScript: plans steps, calls the model, enforces the permission tiers and budget; Lambda + Step Functions-style state in Postgres in Cloud), the sandbox supervisor (Rust, `sypnia-sandbox`: process isolation, filesystem policy, egress proxy with allowlist, resource limits, command log), the sandboxes (local container/VM; Cloud: ECS Fargate tasks, one per agent task), the model gateway (Sypnia AI over OpenRouter, or a direct endpoint), MCP clients for the products, the memory and profile store (Sypnia Data). Rust where a mistake is a security hole (the sandbox and the proxy); TypeScript for orchestration. [Engine, Cloud] - [Request paths](https://agent.docs.sypnia.com/architecture/request-paths.md): Task: POST /tasks → reserve budget from credits (hold) → context load → loop { model proposes step → policy check (tier) → if do: execute in sandbox / call MCP → record step + cost; if ask: create approval, pause } → finish: push branch, open PR, release unused hold. Step execution: orchestrator → supervisor (gRPC over a local socket) → sandbox; egress via proxy. Approval: decision → policy re-check (the world may have changed) → execute → audit. [Engine, Cloud] - [Data model](https://agent.docs.sypnia.com/architecture/data-model.md): Schema agent (Sypnia Data in Cloud; SQLite locally): tasks(id, owner, repository, case_ids, request, state, budget_credits, held, spent, branch, pull_request), steps(task_id, n, kind: model|command|tool|question|approval, input, output_ref, cost, tier, at), approvals(id, task_id, action, effect, state, decided_by, at), questions(id, task_id, text, choices, answer), memory(id, scope person|project, owner, project, text, why, at), profiles(user_id, level, explain, shows, language, test_at), rules(team/project, yaml). Large outputs in S3 (logs, artifacts). [Engine, Cloud] - [On AWS](https://agent.docs.sypnia.com/architecture/aws.md): AWS: CloudFront (agent.app.sypnia.com SPA; agent.api.sypnia.com and mcp.agent.sypnia.com to Lambda), Lambda (Node 22: API, MCP, orchestrator steps), SQS + DLQ (step queue), ECS Fargate (one sandbox task per agent task, no public IP, private subnets, egress via the Rust proxy and a NAT with allowlist), S3 (logs, artifacts), Sypnia Data project (tasks, memory, profiles), Sypnia AI (models), EventBridge (task events to Cases/Git), SNS/mobile push via the App, SSM/KMS. Credits via the Sypnia Cloud ledger. [Cloud] - [Failures](https://agent.docs.sypnia.com/architecture/failures.md): Failures: model provider down or slow → retry with backoff, switch to the fallback model only if the person allowed it, else pause; sandbox dies → the step is retried once in a fresh sandbox from the branch, then the task pauses; orchestrator function times out → the step queue resumes from the last recorded step (idempotent steps); budget reached → stop, save branch; approval not answered in 24 h → pause; Git push rejected → keep work in the sandbox snapshot and ask; MCP product down → that tool fails gracefully, the agent says so and continues or pauses. [Engine, Cloud] - [Codebase](https://agent.docs.sypnia.com/architecture/codebase.md): Repository sypnia-agent (open source): packages/agent (@sypnia/agent: client, runner, CLI), orchestrator/ (TS: loop, policy, budget, context), sandbox/ (Rust crate sypnia-sandbox: supervisor, proxy), skills/ (Sypnia skills), spec/ (OpenAPI, schema of the [agent] table of sypnia.toml), deploy/. Cloud parts (hosted sandboxes, web app, team approvals) in sypnia-cloud. [Engine, Cloud] ## Self-hosting Run the agent and its sandboxes on your machine or your own cloud. - [Self-hosting: overview](https://agent.docs.sypnia.com/self-hosting.md): Self-hosting: the CLI with a local runner is the default (no server). Requirements: a container runtime (Docker or Podman) or the runner's light VM, a model key. For teams: the orchestrator and sandbox supervisor as containers on your own infrastructure (docker compose or Kubernetes), with your own Postgres for tasks and memory, your own egress allowlist. No Sypnia account needed. [Engine] ## Security The threat model, prompt injection, secrets, and the checklist. - [Security: overview](https://agent.docs.sypnia.com/security.md): Threats and defenses: prompt injection via files/web/issues/tool output (content marked as data, never instructions; the policy check is outside the model; no self-approval; egress allowlist limits exfiltration), secret leakage (secrets injected only into processes, redacted from logs and prompts, never in memory), runaway cost (held budgets, hard stops), destructive actions (always-ask tier, re-check before acting, branch-only writes), supply-chain (new dependencies need approval; registries via proxy), sandbox escape (microVM/container isolation, Rust supervisor, no credentials inside), cross-tenant (one sandbox per task, destroyed). [Engine, Cloud] ## Sypnia Cloud Your account and level, teams, limits and plans for Sypnia Agent. - [Sypnia Cloud: overview](https://agent.docs.sypnia.com/cloud.md): Agent in Sypnia Cloud: the Sypnia account (one session, roll-in on first use), the level and memory in the account, teams with shared rules and approvers. Plans: Agent alone (like paying for Claude Code), or inside the global Sypnia subscription; extra capacity per item; prepaid in credits topped up with PayPal; model use and sandbox time spend credits per task. [Cloud] ## Reference Glossary, design decisions, the changelog and common questions. - [Reference: overview](https://agent.docs.sypnia.com/reference.md): Reference for Sypnia Agent: glossary, design decisions, FAQ, changelog. [Engine, Cloud] - [Glossary](https://agent.docs.sypnia.com/reference/glossary.md): Sypnia Agent vocabulary: task, step, level, knowledge test, memory, tier, sandbox, egress allowlist, budget, hold, approval, question, design guide, contract, skill, orchestrator, supervisor. [Engine, Cloud] - [Design decisions](https://agent.docs.sypnia.com/reference/decisions.md): Design decisions of Sypnia Agent: the orchestrator and the sandbox supervisor under AGPL-3.0, the CLI client and Sypnia's skills under MIT; the default model is chosen every quarter by an evaluation on real Sypnia tasks, published in the changelog; teams may allow production deploys without asking, per project, for deploys only, never for production data or messages; the local sandbox uses containers, or a light virtual machine when there is no container runtime; approvals never travel over MCP for always-ask actions; the knowledge test is ten adaptive questions, retakable anytime, used only for how the agent explains; plans: Agent alone or in the Sypnia subscription, extra capacity, prepaid in credits. [Engine, Cloud] - [FAQ](https://agent.docs.sypnia.com/reference/faq.md): FAQ: vs Claude Code (same family; adds use cases, contract, design guide, sandbox and budgets by default, Sypnia products via MCP); can I use my own model (yes); does it work without Sypnia products (yes); can it deploy to production (only with approval); what if I do not program (it explains at your level). [Engine, Cloud] - [Changelog](https://agent.docs.sypnia.com/reference/changelog.md): Changelog for Sypnia Agent docs. [Engine, Cloud]