Aller au contenu
EN English versionDemander une démo

Add an agent written in code

For the person who operates the platform. Procedure agent.code, version 1, reviewed 2026-10-16 against the vendor’s own pages. It applies to the external agent kind code.

It ships with the platform. In the console it opens with How to set this up, beside the form that adds the connector and on the connector’s settings.

Addresses are written <api_url>, <public_url> and <org> here: the console shows the same text with your deployment’s own.

  • A code agent is a Python program that runs under the same guarantees as any agent: the runner starts it, decides its permissions, counts its turns, journals its tool calls and reads its result. Use it for a program of your own that must run governed. A fixed computation with no model is a job; a judgement that instructions can carry is a prompt agent.
  • Two people are involved: the author, who builds the image, and the operator, who names it. A workflow or an agent never writes an image.
  • Read docs/code-agents.md: this page is its checklist.
  1. Write the agent with tranibor-agent-sdk: @agent(name=...), an async def run(ctx) that uses ctx.llm for the model and ctx.tools() for tools, and returns a Result.
  2. Build the image FROM the runner image: the runner is the entrypoint and your agent is the subprocess it starts. Give the agent its own virtualenv. See examples/agents/plain/Dockerfile.
  3. Check it with make conformance-agent IMAGE=<reference> COMMAND='[...]', then push the image and note its digest.
  • The model is reached only through the gateway, with the run’s own key. No provider key is in the pod.
  • tools.call and write_output ask the runner’s guard first. Calling a tool server or a provider directly works and skips the guard: no permission request, no journal line, no turn count.
  • The sandbox (RuntimeClass, network policy, egress proxy) bounds what your code reaches.
  1. The operator names the image: global.images.agents in the chart maps a name to a reference pinned by digest. By default (global.images.requireDigest: true) a tag-only reference stops the API and the workers at start-up; false is for a bench only.
  2. Agents, New, Runtime: choose Code (image). Pick the image by its name, give the command (one argument per line) and the model API (openai or anthropic).
  3. Run it from a workflow like any registry agent. Use an executor that starts a pod per run (k8s_job): agent_sandbox runs one pool image and refuses a run whose image differs.

Run the conformance suite on the image, then run a one-step workflow with the agent and read its journal and its result.

  • An unknown image name is refused at publication, and the error lists the known names: the operator has not named it yet.
  • The API or the workers stop at start-up naming a tag-only reference: pin the image by digest.
  • agent_sandbox refuses the image: the pool was made from another one; use k8s_job.
  • The run ends max_turns, or permission_denied: the guard stopped it, by design.
  • agent_error: your function raised; the journal has the traceback line.

Hosts the platform must be allowed to reach:

  • the registry that holds the agent image