Developers using Codex or Claude Code
Keep the agent and the login you already have on your machine, and reach it from a script, a cron job or another terminal.
Install Portrail next to Codex or Claude Code, give it a folder and an API key, and drive the agent from anything that can make an HTTP request — curl, a script, Zapier, Make, n8n, your own app. The agent does real work: it runs commands and edits files. Your rules decide what it may do without asking.
$ npm install -g portrail
curl -X POST http://127.0.0.1:7431/v1/runs \
-H "Authorization: Bearer prt_…" \
-H "Content-Type: application/json" \
-d '{
"agent": "codex",
"workspace": "my-app",
"prompt": "Fix the failing test in auth.ts",
"wait": 300
}'
That request returns when the agent is done, with what it did and what it said.
Keep the agent and the login you already have on your machine, and reach it from a script, a cron job or another terminal.
Make, n8n and Zapier scenarios call one HTTP endpoint and get back what the agent did. Idempotency keys make retries safe.
Every operation the agent proposes is checked at one decision point, and every decision is recorded with the rule that produced it.
Codex and Claude Code, through their own permission hooks, using the login you already have — no OpenAI or Anthropic keys copied into your automation tool. Portrail itself is reached with its own bearer key.
Every operation the agent proposes is checked against your rules before it starts. A refused operation is never started, and the agent is told why. What an allowed operation then does is the agent's — and its sandbox's — business, not Portrail's.
Runs, sessions, resumable event streams, cancel, steer, wait for synchronous callers, and idempotency keys for automations that retry.
Bind to an interface with TLS, put it behind a proxy, or portrail start --tunnel for a public URL on a laptop behind NAT.
If Portrail loses track of an agent mid-run, the run ends as outcome_unknown — never a silent success, never a replay. A run that finished but had something refused says so.
portrail service install on macOS or Linux. portrail doctor checks Node, finds your agents, and tells you what to fix.
Both agents ask permission before acting. Codex sends a request over its app-server protocol; Claude Code calls a hook. Portrail answers those questions from your rules, which means it governs what the agent does without being a sandbox around it.
Each operation the agent proposes is checked before it starts. A refused operation is never started, and the agent is told why.
“May I run npm test?” — the agent asks before it acts.
Allow or deny, from your rules, at one decision point.
Portrail ships with an allow/deny list: reads and workspace writes are free, a named set of development commands is free, secret files are refused for reading and writing, obviously destructive and network commands are refused, and anything unmatched is refused — or, if you put it in decide.ask, portrail run asks you at the terminal. Compound commands are judged one segment at a time.
It is a starting point for a repository you trust, not a security boundary against hostile input — read the security model before pointing an agent at untrusted content.
$ portrail run --workspace my-app \
"Add a --version flag to the CLI"
● reading src/cli.ts allowed
● writing src/cli.ts allowed
● exec npm test allowed
● exec curl https://… denied
succeeded · 1 operation refused
npm install never compiles anything.portrail doctor checks all of it and tells you what to fix.Early release. Tested on macOS and Ubuntu 24.04 with both agents: real runs, tarball install, the systemd service, crash recovery under kill -9, and a Cloudflare tunnel from the public internet.
The API is stable within 0.x for the routes documented in the API reference. Published versions are listed on Releases and in the changelog.