Configure your agent
Update a service agent’s instructions, model and tools, then choose the version offered to end users. Saving and applying configuration are separate actions. Issued grant codes and access tokens retain their pinned version.
Prepare your agent
You need an existing service agent and an organization account authorized to manage it. Open Service agents → Select agent → Settings (设置) in the Dashboard. UI labels below describe the current Chinese Dashboard.
For API access, obtain the public agent_… ID from a create or retrieve response. Set PRAXIS_API_BASE to your environment’s API origin and PRAXIS_API_KEY to its organization API Key on your server. Keep the Key out of browser code. The example requires Node.js with native fetch and PRAXIS_AGENT set to the real public ID.
Update and save configuration
- In Instructions (指令), define the agent’s role, answer scope and response when information is missing.
- In Model (模型), select an available model, such as
deepseek-flashwhen listed for your organization. - In Tools (工具), enable tools and choose automatic execution or confirmation on every call. Configure MCP servers in MCP servers (MCP 服务器). Tools must still authorize users on the server.
- Review changed groups in the bottom save bar and click Save (保存).
Expected: The configuration version increases. Reopening Instructions shows the saved text. Leaving with unsaved changes prompts you to handle them.
Save this as configure-agent.mjs and run node configure-agent.mjs on your server. It reads the current version, updates instructions and model with POST /agent/v1/agents/{agent_id}, then reads back the result.
import assert from 'node:assert/strict';
const { PRAXIS_API_BASE, PRAXIS_API_KEY, PRAXIS_AGENT } = process.env;assert(PRAXIS_API_BASE && PRAXIS_API_KEY && PRAXIS_AGENT, 'Set the three environment variables');assert(PRAXIS_AGENT.startsWith('agent_'), 'Use the public agent ID');const url = `${PRAXIS_API_BASE.replace(/\/$/, '')}/agent/v1/agents/${encodeURIComponent(PRAXIS_AGENT)}`;async function request(method, body) { const response = await fetch(url, { method, headers: { Authorization: `Bearer ${PRAXIS_API_KEY}`, 'Content-Type': 'application/json' }, ...(body === undefined ? {} : { body: JSON.stringify(body) }), }); if (!response.ok) throw new Error(`Agent request failed: HTTP ${response.status}`); return response.json();}const before = await request('GET');const system = 'You help customers understand our courses. Ask for missing details; do not invent course policies.';const saved = await request('POST', { version: before.version, system, model: 'deepseek-flash' });const after = await request('GET');assert(saved.version > before.version);assert.equal(after.version, saved.version);assert.equal(after.system, system);assert.equal(after.model.id, 'deepseek-flash');console.log({ id: after.id, version: after.version, verified: true });Expected: The script prints verified: true and the new version. The model must be available to your organization. Concurrent edits cause version validation to reject the update. Read the latest configuration and reconcile changes before trying again. See the Agent API for all fields.
Save, apply and the fields saved with a version
Saving creates a new version, but active_version decides which version new sessions use. POST /agent/v1/agents/{agent_id} applies immediately by default; send apply: false to save a draft only, then use POST /agent/v1/agents/{agent_id}/versions/{version}/apply to apply it or to roll back. version_note records a change note. The whole flow is in Manage agent versions.
Besides instructions, model and tools, these fields are also saved with the version, so changing them creates a version too and can be held back from taking effect:
| Field | Purpose |
|---|---|
bindings | Limits what codemode can reach on the platform; replaces the old databases, vector_stores and files resource fields. See the next section |
skills | Attached skills; see Use skills |
environment_id | The runtime environment sessions use by default; see Runtime environments |
vault_ids | The vaults sessions use by default (service agents; at most 50, each an active vault) |
avatar | The avatar: an absolute https URL of at most 2048 characters; send null to clear |
Bind platform resources and services
Use bindings to allowlist the platform resources and services a service agent can reach through codemode. It is an array whose items each carry a type, in two kinds. Only kind: "service" accepts a nonempty array; general and personal agents return 400 for it. Each type accepts at most 20 entries, the same type and id must not repeat, and each service type appears at most once. The former databases, vector_stores and files fields are removed and return 400.
This public HTTP example needs no SDK installation. Set PRAXIS_API_BASE and PRAXIS_API_KEY on your server, save it as bind-agent.mjs, and run node bind-agent.mjs. It creates an empty database, binds it read-only, and enables the search service. No existing workflow is required.
import assert from 'node:assert/strict';
const { PRAXIS_API_BASE, PRAXIS_API_KEY } = process.env;assert(PRAXIS_API_BASE && PRAXIS_API_KEY, 'Set PRAXIS_API_BASE and PRAXIS_API_KEY');async function request(path, body) { const response = await fetch(`${PRAXIS_API_BASE.replace(/\/$/, '')}${path}`, { method: 'POST', headers: { Authorization: `Bearer ${PRAXIS_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify(body), signal: AbortSignal.timeout(30_000), }); const result = await response.json(); if (!response.ok) throw new Error(`HTTP ${response.status}; ${result.error?.message}; request=${result.request_id}; trace=${response.headers.get('X-Request-Id')}`); return result;}const database = await request('/database/v1/table', { name: 'Course catalog' });const agent = await request('/agent/v1/agents', { name: 'Course assistant', kind: 'service', model: 'deepseek-flash', system: 'Use codemode to read the bound course catalog. Use praxis.search for web research when needed.', bindings: [ { type: 'database', id: database.id, access: 'read_only', instructions: 'Course catalog for customer questions.' }, { type: 'search' }, ],});const session = await request('/agent/v1/sessions', { agent: { type: 'agent', id: agent.id, version: agent.version },});assert.equal(agent.bindings[0]?.id, database.id);assert.equal(agent.bindings[0]?.access, 'read_only');assert.equal(agent.bindings.length, 2);assert.equal(session.environment_id, 'node22');console.log({ database: database.id, agent: agent.id, session: session.id, verified: true });Expected: Database, agent and session IDs plus verified: true. The assertions verify saved bindings and the default environment, not runtime queries. The database is empty; populate business tables with organization credentials before asking the agent to query them. Saving a binding does not guarantee the resource still exists or is accessible. Use real IDs from resource APIs and check runtime errors.
{type: "search"} opens praxis.search.* through codemode. It does not enable the native web_search tool. The former is a platform service binding; the latter is an agent tool configuration. Choose the integration and name it in your instructions. Tool configuration does not replace codemode binding authorization.
Resource bindings carry an id, and the type decides which access is allowed:
| type | id | Allowed access |
|---|---|---|
database | Starts with db_, from praxis.database.table.list/create or praxis.database.kv.list/create | read_only, read_write |
vector_store | Starts with vs_, from praxis.knowledge.vectorStores.list/create | read_only, read_write |
file | Starts with file-, from praxis.file.files.list/create | read_only |
media_library | A media library ID without : or whitespace | read_only, read_write |
model | A model catalog ID without : or whitespace | invoke |
workflow, script | <namespace>/<name>, no /, @, : or whitespace inside a part | invoke |
agent | Starts with agent_, the public ID of another agent | read_only, read_write |
application | Starts with wkr_, from the Application API | read_only, read_write |
Use the returned id, not the name. Each entry accepts optional instructions of at most 4096 characters and enabled, which defaults to true. read_only allows reads and refuses writes; invoke allows calls.
Service bindings open a whole service and carry only enabled (default true). Supported types include search, browser, ticket, crm, canvas, cut, studio, ontology, workforce (read and write), and the read-only workforce_read, registry_read, members_read and media; the full list is in the Agent API. Except for ticket and media, which are on by default (turn it off with {type: "ticket", enabled: false}), services are closed when no binding is present; enabling one makes all of that service’s public methods reachable through codemode. media is read-only: it lists libraries, reads an asset and mints a signed read link, and cannot upload, edit, generate or delete. Passing id, access or instructions, or an unknown type or field, returns 400. Before enabling a service for end customers, assess the full set of operations the agent could perform on their behalf and enable only services needed for that customer journey.
Use POST /agent/v1/agents/{agent_id} to submit the complete bindings array. Omitting the field preserves it; [] or null clears it. Bindings are saved with the agent version: an added binding applies only to new sessions created from the new version; applying a version that disables (enabled: false), removes or downgrades a binding revokes it immediately in sessions still running an older version; a draft saved with apply: false changes no access. See Manage agent versions.
Through codemode, unbound resources return 404 and services that are not opened return 403. Writes to read-only resources return 403 BINDING_READ_ONLY. Codemode discovery (search, describe and the namespace listing) lists only the domains the agent’s bindings can reach: an agent with no bound resources discovers nothing, every method that is listed can be described and called, and a method outside the list is refused by the rules above when called.
Runtime environment
A service agent’s default environment is the environment_id saved in its version; a new agent gets the built-in node22 (a Node.js 24 sandbox). Omit environment_id when creating a session to use that default. The response contains session.environment_id: "node22", as above, and a value the session sends itself wins. Explicit null allocates no machine, so the session has no machine tools such as codemode or bash and cannot install skills. Keep the default environment to use bound data. To build your own environment, preinstall packages or limit the network, see Runtime environments.
Configure access and versions
Configure website origins, sign-in methods and access budgets in the Dashboard under 接入 → 接入方式与外观 → 嵌入设置 and 用量. See Secure your embed for origin rules. Dashboard private endpoints are not public APIs.
Runtime environment and vaults are the agent version’s environment_id and vault_ids, configurable through the public update endpoint. They are no longer selected in embed settings. The old embed-policy environment and vault fields are deprecated and ignored. Save these changes as a new version and apply it before issuing a grant code.
Choose the customer version
Apply or roll back with POST /agent/v1/agents/{agent_id}/versions/{version}/apply. An explicit version takes precedence when issuing a customer grant code; omission uses active_version at issuance. See Customer sign-in.
Existing grant codes and access tokens keep their pinned version; existing sessions do not upgrade. Issue a fresh grant code and start a new session to verify configuration changes. Do not rely on the old embed-version pin setting.
Verify and continue
In Integrate → Playground (接入 → 试用调试), select the saved version and ask a question that distinguishes the new instructions from the old ones. Check the actual reply. Then obtain a new token in your host application, start a session, and confirm its version under Sessions (会话). A loaded interface alone does not prove the new configuration is in use.
Service agents do not currently support per-message model switching, tool modes, voice input or per-end-user memory. For appearance, use Customize appearance.
Next: Test your embed · Agent API · Cookbook