egin
Write an agent as a folder of files and run it with one binary.
$ npx egin@latest init my-agentStart from a template with --template research, ops or support.
How it works
An agent is a folder. Commit it, and review a change to its instructions like any other diff.
my-agent/ agent.toml model and settings instructions.md system prompt tools/ scripts the agent can call skills/ instructions loaded when needed evals/ prompts and checks workspace/ files the agent works on
A tool is one script. Its opening comments say what it does and what it takes, the arguments arrive on stdin, and whatever it prints is the result. Any language works.
#!/usr/bin/env python3
# description: GET a URL and report the status code and latency.
# safe: true
# param url (string, required): The URL to check
import json, sys, time, urllib.request
url = json.load(sys.stdin)["url"]
start = time.time()
status = urllib.request.urlopen(url, timeout=3).status
ms = int((time.time() - start) * 1000)
print(json.dumps({"status": status, "ms": ms}))Tools run in a microVM made for each session. It reaches only the hosts you list, and it never sees your secrets: the real token is swapped in on requests to its host.
network = ["example.com"]
secrets = [{ name = "GITHUB_TOKEN", host = "api.github.com" }]Each step is saved before the next one starts. Kill the process and run the session again: it carries on from the last saved step, without repeating a model call.
- read_filerunbooks/http-health.md3 ms
- http_checkhttps://example.com182 ms
- Process killed
- egin run my-agent --session 01JD7…
- http_checkhttps://example.com/api3.0s
- write_fileincidents/2026-11-16.md5 ms
- DEGRADED: /api timed out twice. Incident note written.
An eval is a prompt and a check. egin eval runs each one under every variant of your settings, so you know what a change is worth before you keep it.
prompt = "Run the health check runbook. Reply with the status."
expect = "OK"[default]
[bash-only]
tool_style = "bash"Commands
- Write a starter agentegin init
- Run one promptegin run
- Talk to it in the terminalegin chat
- Serve it over HTTPegin serve
- Run its evalsegin eval
- Tune a model's profile from evalsegin evolve
- Run Terminal-Bench or SWE-bench tasksegin bench
- Turn results into one HTML pageegin report
Serving
egin serve my-agent starts an HTTP API on port 8787. Start a session with a POST, then follow its events as they stream.
curl localhost:8787/sessions -d '{"message": "Check the targets"}'
curl -N localhost:8787/sessions/{id}/eventsTo reach the agent from other services, add a channel. A webhook takes HMAC-signed POSTs, one session per thread.
secret = "${OPS_WEBHOOK_SECRET}"Slack works over Socket Mode, so the server needs no public URL.
app_token = "${SLACK_APP_TOKEN}"
bot_token = "${SLACK_BOT_TOKEN}"To run a prompt on a timer, add a schedule.
cron = "*/15 * * * *"
prompt = "Run the HTTP health check runbook."To put the agent in a web app, use the React hook. Start from --template web for a full chat with attachments and approvals.
import { useAgent } from "egin/react";
const agent = useAgent({ baseUrl: "/egin" });
agent.send("Summarise this", files);
agent.approve(callId, true);Benchmarks
egin against eve on the same model with the same web tools, over all 165 GAIA validation tasks. egin passes more on every model, at 31 to 58% less cost.
| Model | egin | eve | Cost, egin / eve |
|---|---|---|---|
| Claude Sonnet 5.5 | 136 | 130 | $16.46 / $23.76 |
| Qwen4 Max | 136 | 119 | $19.10 / $27.77 |
| GPT-6.1 Sol | 129 | 124 | $12.58 / $22.35 |
| Claude Haiku 5.5 | 114 | 108 | $1.19 / $1.74 |
| GPT-6 Luna | 103 | 98 | $0.80 / $1.89 |
Passes out of 165, dropping any pass whose search results quoted the question and its answer in agent or benchmark write-ups. On SimpleQA Verified’s 1,000 questions the two tie. Every run, including Terminal-Bench and SWE-bench, is in Results.