How the agents work

Agents read
People approve
Opswren proves it worked

Opswren's agents look at your servers and code, plan a fix with the result each step should have, and wait for a person to approve it
Then they act one step at a time, measure what changed, and check the outcome
Here's the engineering behind it

How it works

Connect a server
Let an agent plan
Watch it work

No open ports and no new AI bill
The agent dials out, and the AI that writes code is the one already on your server

$ 
connected · outbound only
1

Connect a server

One command installs the agent: Linux or macOS, as a systemd or launchd service
It connects out over a WebSocket and runs only checks from its own allowlist

Plan · Deep clean · macbook
  • Clear ~/Library/Cachesfrees 11.0 GB · 94% → 89%
  • Clear Xcode iPhone supportfrees 5.5 GB · 89% → 86%
  • Clear Gradle cachesfrees 8.0 GB · 86% → 83%
  • Empty the Trashhigh risk · waits for you
2

An agent plans

Every step comes with the result it should have
Safe steps are ticked for you, risky ones wait for your approval, and your own files are only ever shown for you to decide about

Planned
Running
Verified
DISK-94Deep clean macbook3 steps
3

Watch it work

The card moves as the agent works
Each step shows the measured result next to the expected one, and the work item closes itself once the check passes

Live

Your phone on one side, the server on the other

You tap on the phone
The backend sends the agent a check or a cleanup by name, and the agent decides what it will run
Every message below uses the agent's real message types

Your phone
9:415G ▮
Opswren
ALERT · macbook Disk is 94% full
13 GB free
DEEP CLEAN 3 safe cleanups ticked
Clean selectedmacbook · agent online
✓ Freed 24.5 GB · 94% → 83%
← outbound only · TLS
macbook online
opswren-agent 0.4.0

        
waiting for a run…
Run record

One run
Every decision attached

Each agent run keeps what it saw, what was approved and by whom, what ran, and what changed
You can open it later from Activity

Run record ILLUSTRATIVE RUN · FIX PLAN ON API-1
9Steps proposedby the alert agent
2Held for approvalneeded RUN typed
1Dropped before showingmatched a forbidden pattern
6Ran and measuredbefore and after each
ALERT · DISK FULL / FIX PLAN

Disk 93% full on api-1

  1. Observe
  2. Explain
  3. Plan
  4. Approve
  5. Act
  6. Measure
  7. Verify
  8. Remember
ACTION RECORD READ-ONLY

The agent runs read-only checks on api-1

Agent
Infrastructure agent: disk
Server
api-1 (pinned to this plan)
Command
disk_breakdown
Expected
–
Result
–
CURRENT STATE
Observing

Nothing on the server can change in this step

Changes on the server
None
Approval
Not needed yet
Remembered
No
The agents

What each agent does, technically

Some write code, some look after servers
All of them follow the same steps and the same guardrails

code

Fix with agents: a crew of five

Takes a failing pull request or an issue all the way to a fix
The Analyzer reads the failing checks and their CI logs (or the merge conflict)
The Planner, the AI tool on your server, proposes a fix after reading the code in read-only mode
After you approve, the Fixer edits the code and runs the tests, the Executor pushes onto the pull request's own branch, and the Verifier watches the checks on the new commit
If they still fail, it goes round again

code

Changes across linked repositories

One plan with the backend and both apps checked out side by side, a pull request in each, and one approval
They ship in order
If one fails, the rest are held and their approvals cleared
If Opswren restarts partway through (deploying itself does that), it carries on with the rest, using the approval already given

code

Second look and proof of the fix

A fresh session, preferably a different AI tool, reviews the finished change in read-only mode
For a bug fix, the AI adds a test that reproduces the bug
Opswren runs it before the fix (it should fail) and after it (it should pass), so the approver sees evidence, not just the AI's word

code

Deploy fixer

A merged change that failed to deploy: it reads the deploy output, plans a fix, and after you approve runs the steps and deploys again
Each new plan includes what was already tried
After three rounds it hands over to a person

code · new

When CI can't run, Opswren runs it

GitHub Actions jobs that ended without ever starting (no minutes left, a failed payment), or that sat queued for over 20 minutes, are told apart from a real test failure
Opswren then reads the repository's own .github/workflows and takes the run steps of the jobs that test pushes and pull requests, leaving out deploy, release and publish jobs, jobs with an environment, and anything that needs secrets
Python projects get a throwaway virtualenv, and with no workflow it uses the detected or configured test command
It runs on a team server with an SSH login, the tools the job needs (git, Python, Node, Java, the Android SDK, or a Mac for macOS jobs) and enough free memory, the repository's own deploy servers first
It works in its own folder, at low priority, with a 25-minute limit, and is cleaned up after
The result goes on the change (passed, failed, or not checked when no server can run it) and on the commit on GitHub as opswren/ci

code · new

Merges and Deploy on push follow CI

If CI didn't run, the checks run before a merge
Failed checks stop the merge unless an admin approves with a reason, which is logged and the other admins are told
Deploy on push waits while CI runs, doesn't deploy a commit CI failed (the team is told), and leaves the deploy to CI when CI's own deploy job shipped it
When CI didn't run, it runs the checks first and deploys only if they pass

opswren itself · new

Opswren's own backend survives a bad deploy

Before anything restarts, the new commit is checked out on the side, and it must import and run its database migrations on a copy of the live database
If it can't, nothing is touched
The database is backed up before every deploy (the last 7 are kept), and if the health check doesn't pass within a minute, the code goes back, and the database too if migrations changed it
Five failed starts within two minutes return it to the last commit that deployed fine
While it restarts, the apps show "Opswren is restarting" instead of a raw 502 error, and Opswren deploying itself after a merge in the app goes through the same checks

servers · new

Ask a server why it spiked

The CPU, memory, disk and load readings around that time, compared with the hour before, the incidents open then, and for anything in the last 30 minutes, fresh read-only checks (busiest processes, memory, disk, errors)
The AI replies with the likely cause, the evidence and what to do
Asking can never change the server

servers · new

Clean cache and Deep clean, Linux and macOS

A breakdown script ranks every possible cleanup, safest and biggest first
On a Mac it measures the data volume, not the read-only system volume, and clears Xcode, simulator, npm, Gradle, Homebrew and Docker caches through named cleanups that the Mac's agent runs itself

servers

Disk agent

Started by an alert or by hand
It runs df before and after every step and stops once the disk is below the target, then takes a second, deeper look
Anything that could delete app data waits for a person

servers

Network doctor

Takes two snapshots of the kernel's TCP counters five seconds apart (ListenOverflows, ListenDrops, RetransSegs, resets) and checks somaxconn and HTTP/2
Its fixes include a backup and an nginx -t test before reloading

servers

Alert agent and fix plans

An alert becomes a plan tied to its server
If the plan is more than 30 minutes old, the server is checked again before anything runs
A snapshot of what the agent saw is kept with the plan, and risky steps need RUN typed to confirm
Close it or mark it won't do, and it stays closed while the alert keeps firing

servers

Exposure watch

Once a day, each server's public address is looked up in Shodan's passive InternetDB
Each risky port it lists is then tried from Opswren, a plain TCP connect that sends nothing, so an alert only fires for a port that really answers now, not days-old scan data
Known CVEs raise alerts too, and it checks the SPF and DMARC records for your alert emails
Its fix closes the port: Redis set to listen on 127.0.0.1 with a backup of its config, the port blocked in the firewall, and the port tried again from outside to prove it

servers

Discovery

A read-only scan finds git checkouts, Docker and Compose projects, systemd services, PM2, nginx sites and listening ports
It links each app to its repository with a health check

ai

Your AI, where your code is

Claude Code, Codex, Gemini CLI or Qwen Code, already signed in on your server
If one isn't available, Opswren tries another tool on the same server, then your other servers, then your own API key
Tools over their usage limit are skipped until it resets, and tokens are counted for every run
Each plan records exactly which AI answered: the tool, its version and the model, so a silent switch down the chain is visible

Guardrails

Built into the code, not just the policy

Each rule below is enforced in the code, and tests check it

Approvals pinned to a commitAn approval is for the exact SHA you reviewed
It works once and expires after 24 hours
A push after approval stops the merge
Checked twiceDeploy windows, freezes, "someone else approves" and "tests must pass" are checked when you approve and again just before the merge
An allowlist on the serverThe agent runs only its fixed checks, root-owned deploy scripts and named cleanups
A compromised backend still can't make it run shell commands
Where a command came fromA step whose command, web address or host appears in a Slack message, email or issue, but not in what Opswren saw on the server, is marked as coming from that message and needs RUN typed
Forbidden commandsSuggestions like rm -rf /, mkfs, dd if=, reboot or a change to authorized_keys are dropped before anyone sees them, and each drop is written to the Activity log for admins to review
Secrets by name onlyA plan step refers to {{secret:NAME}}
The value goes over SSH stdin only when the approved step runs
MaskingKnown secrets, and anything shaped like a token, private key or password, are masked in output, AI requests and transcripts
Budgets and a watchdogBy default, 8M AI tokens per run and 60M per day
Work stuck for 90 minutes, or runs going past 2 hours, are stopped and explained
Graded before it shipsEvery change to a prompt, model or the planner is replayed against past incidents and graded on the path, not only the answer: a test included, safest steps first, nothing forbidden, nothing copied from a message, no failed fix repeated
Proof, not hopeAfter a fix, the plan's own read-only test and the alert's condition measured again live decide
A plan whose test fails is remembered as one that didn't work, and a new plan is made with what the test showed
The right machineEach server remembers the machine its agent runs on
A token used on another computer raises a critical alert and holds deploys until a person confirms it
While the server's own agent is reporting, a second computer with its token is turned away, so the two never swap places
Survives restartsPlanning starts again, code writing carries on from the server's copy, and shipping carries on in order
Shipped

What's new

Small steps, each one tested, deployed, and explained in the docs

  • Questions answered in chat: "check disk space on web-1" asked in Slack or Discord is answered in the thread from the read-only check catalog, explained by the team's AI, with no approval and the item closed with the answer; anything with an action word still waits for a person
  • Progress in the thread: whoever asked in Slack or Discord sees each step, once: looking into it, fix plan ready, working on the change, waiting for approval, deploying, done
  • When CI can't run, Opswren runs it: GitHub Actions jobs that never started (no minutes left, a failed payment) or sat stuck in the queue are spotted, and the repository's own workflow test steps run on a team server instead, with the result on the change and on the commit as opswren/ci
  • Merges and Deploy on push follow CI: failed checks stop a merge unless an admin approves with a reason, and Deploy on push skips a commit CI failed, leaves the deploy to CI when CI shipped it, and runs the checks itself when CI didn't run
  • Opswren's own deploys are checked first: new code must import and migrate a copy of the live database before anything restarts, with a database backup, a rollback if the health check fails, a crash guard, and a "restarting" message in the apps instead of an error
  • One machine per agent token: when a second computer starts an agent with a server's token while the server's own agent is reporting, it is turned away and the admins are told which computer tried, instead of the two pushing each other off every 30 seconds
  • Deploy on push: no GitHub Actions minutes left, or no pipeline at all: Opswren watches the branch and deploys each new commit within a minute, checked, rolled back if it breaks, and never retried until the next push
  • The deploy agent: for code with no CI/CD, Opswren sets deploys up from the app (deploy key, the code on the server, a service, a root-owned script), checks every deploy and rolls back to the previous commit if the app doesn't come up
  • AI assistants over MCP: Claude, Cursor or Claude Code connect with a token from Settings and can look, ask a server and ask for a fix plan, but never approve or run one; every call is in the Activity log
  • Discord: mention the bot and the message becomes a work item, with the answer as a reply and incidents posted to an alert channel
  • Which AI answered, on the record: each plan keeps the tool, version and model that made it, and the replay set shows when a case is answered by a different AI
  • Open ports actually get closed: without AI, the built-in plan now makes Redis listen on this server only (with a backup of its config) and blocks the port, then tries it from outside; it used to only look
  • A config test before every restart: a stopped nginx, Apache, HAProxy or Caddy is checked with its own config test, restarted only if that passes, then checked to be running
  • The replay set: past incidents replayed through the planner and graded case by case, so a prompt or model change that makes plans worse is caught before it ships
  • A message can't sneak in a command: a step that came from a Slack message, email or issue is marked and needs RUN typed
  • Every blocked command is on the record: what the guard dropped, and why, is in the Activity log
  • Risky ports tried live: an exposure alert only fires for a port that answers right now
  • Proof after every fix: a test script and the alert measured again live run after the steps; only a pass counts as fixed and is remembered
  • Approve or reject from the notification: buttons right in the list, with the same typed confirmations and rules
  • An agent on a different machine is caught: admins are told and deploys are held until someone confirms it
  • A closed alert stays closed: won't do keeps it quiet while it fires, so the same plan doesn't run again and again
  • Showing the install command no longer disconnects a running agent: a new token stays pending until an agent connects with it
  • Ask a server why it spiked: a question box on every server, on iPhone, Android and the backend
  • Mac cleaning: the data volume is measured, and named cleanups run by agent 0.4.0
  • Linked changes resume after a restart, in order, using the approval already given
  • Review the changes like a code review, plus second look and proof, exposure alerts and fix plan safety
  • Deploy fixer, up to three rounds
  • Tailscale built in: a userspace tailscaled per team, so nothing needs an open port
  • App down alerts, Slack incident threads, CI results as test results
  • Mac as a deploy target for building the iPhone app

See it on one of your servers

We'll set it up with you in about 30 minutes, free during the pilot, and ship one real fix from your phone, start to finish