Qoder Agent SDK is officially open, letting you build production-grade agents quickly.
Qoder Agent SDK opens the Harness behind the Qoder product family in SDK form. Task planning, tool invocation, context and session management, permission control, and long- and short-term memory — this whole runtime is now embeddable directly in a TypeScript or Python application.
Qoder Agent SDK provides a mature agent runtime and flexible integration points. Through SDK integration you can wire your own tools, internal data, and business systems into an agent's execution path, and get a production-grade agent that completes tasks end to end inside your own product.
Qoder Agent SDK is the application-facing API. QoderCN CLI is the agent runtime that plans the task, communicates with the model, and executes tools in the target environment.
Published Qoder Agent SDK packages include a compatible QoderCN CLI runtime, so a separate QoderCN CLI setup is normally not required. If you manage the runtime yourself, you can point to a specific
Use the same language as the application hosting the agent.
See Quick Start for complete, runnable examples in both languages.
A typical integration has four parts:
The SDK References page maps concepts across languages. A few capabilities exist in only one language; they are marked inline and listed together in Language differences.
An agent produces real changes to its environment. Its working directory, tools, credentials, and permission policy are part of the application's security boundary.
What you can build
Qoder Agent SDK provides a mature agent runtime and flexible integration points. Through SDK integration you can wire your own tools, internal data, and business systems into an agent's execution path, and get a production-grade agent that completes tasks end to end inside your own product.
| Agent shape | Typical use |
|---|---|
| Coding agent | Embedded in an IDE or an in-house dev tool: the agent reads the whole repository, then writes code, fixes bugs, and runs tests while developers review the result |
| Terminal agent | Diagnosing production incidents on a server, bulk-editing configuration, running ops scripts, with dangerous commands escalated for human approval |
| Workplace agent | Pulling data from several internal systems to compile weekly reports, clean up spreadsheets, and produce documents from company templates, delivered as ready-to-use files |
| Pipeline integration | Fixing failing tests, completing documentation, and reviewing every commit inside CI, running read-only and exiting when done |
| Vertical agent | A domain assistant for finance, healthcare, and similar fields, connected to industry systems and proprietary data, working inside a compliance boundary |
Qoder Agent SDK and QoderCN CLI responsibilities
Qoder Agent SDK is the application-facing API. QoderCN CLI is the agent runtime that plans the task, communicates with the model, and executes tools in the target environment.
qoderclicn executable.
For the detailed startup, communication, and agent loop, see How it works.
Choose an SDK
Use the same language as the application hosting the agent.
| TypeScript | Python | |
|---|---|---|
| Package | @qodercn-ai/qodercn-agent-sdk | qodercn-agent-sdk |
| Runtime requirement | Node.js 18+ | Python 3.10+ |
| One-off tasks | query() | query() |
| Multi-turn sessions | Async message input to query() | QoderSDKClient |
| Output | Async stream of typed messages | Async stream of typed message objects |
Integration flow
A typical integration has four parts:
- Describe the task. Send a prompt, and set the working directory, model, system prompt, and turn limit as needed.
- Set boundaries. Pick the allowed tools and permission mode; for actions that need application-side approval, hand the decision back through a callback.
- Consume the message stream. Handle model replies, tool activity, progress events, and the final
resultmessage. - Control the session when needed. Long-lived integrations can send follow-up messages, interrupt the run, adjust selected runtime settings, or query session state.
query(). When the next input depends on the previous output, use the language-specific multi-turn form in Multi-turn Conversation.
Configurable capabilities
| Capability area | What it covers |
|---|---|
| Input and output | One-off or multi-turn input, image input, structured messages, and partial streaming events |
| Tools | Built-in file and command tools, custom tools, and external or in-process MCP servers |
| Agent behavior | System prompts and output styles, models, skills, plugins, reusable agent definitions, and subagents |
| Safety and control | Tool allowlists, permission modes, approval callbacks, hooks, interruption, and turn limits |
| Code security | Static checks on the agent's own edits, plus lightweight and deep repository scans |
| Memory | Native user and project memory, or application-owned generation and consumption (TypeScript only) |
| Session management | Working directory, persistent sessions, resume and fork, checkpoints, external session storage, usage, and context information |
| Task execution | Background tasks, task listing and cancellation, and per-task interruption |
| Configuration | Inline settings, filesystem setting sources, and resolved-settings inspection |
Execution boundaries
An agent produces real changes to its environment. Its working directory, tools, credentials, and permission policy are part of the application's security boundary.
- The SDK-to-QoderCN CLI channel is local by default, but QoderCN CLI talks to the Qoder model service; prompts and the context needed for inference are sent there.
- File writes and commands run in the environment where QoderCN CLI is running. Set
cwdexplicitly, and tighten what can execute with Permissions. - The model does not read or write files or run commands directly. It only requests tool calls, which QoderCN CLI validates and executes under the configured policy.
- Permission-bypass modes are only appropriate in environments that already provide an external isolation boundary.
Next steps
- Quick Start — install, authenticate, and run your first task
- How it works — understand the SDK communication channel and the QoderCN CLI agent loop
- Permissions — tighten tool access and approvals
- SDK References — look up TypeScript and Python APIs