XWatch
v0.2.0Free local security checks for coding agents: scans git changes, alerts only on proven findings.
These are results of Xtarwall's engine (the recipe layer and the full engine), not of an xwatch run on your machine. XWatch carries the same "no exploit, no alert" rule. Last re-run: 29 Nov 2026. Definitions, pinned versions and misses: how we measured. The demo boots a fictional vulnerable app, attacks it, and checks that the safe version of each feature stays quiet. Offline, no AI key, no spend.
Summary extracted from the README.
XWatch: open-source app security for coding agents that alerts only on a proven exploit
XWatch is a free, open-source security check that runs before you push. It reads what changed in your git repo, works out which security risks the change reaches, and returns findings your coding agent can act on, with a fix. It raises an alert only when a test actually reproduced the problem: no exploit, no alert. It runs on your laptop, in CI, or inside Claude Code, Codex and Cursor as an MCP server, with your own AI key. Nothing is hosted.
What it does
- Change-aware. Scans staged, unstaged and untracked changes against
HEADor a base branch, not the whole repo every time. - Four honest states. Every finding is Confirmed (a test reproduced it, with proof), Suspected, No issue or Not assessed. Only Confirmed is an alert.
- Passive by default. Nothing is executed against anything until you give consent for one named target and a live scope grant; active tests run only against the short-lived copy you name, never production.
- Your key, your machine. Anthropic, OpenAI, Google Gemini or Groq. With no key set, every model call goes to an offline mock and costs nothing; a paid call needs a run budget you set.
- Built for the flaws that cost money. Free credits drained, browser-only quotas, AI endpoints anyone can call on your bill, one tenant reading another's data.
The engine behind it, measured
These are results of Xtarwall's engine (the recipe layer and the full engine), not of an xwatch run on your machine. XWatch carries the same "no exploit, no alert" rule. Last re-run: 29 Nov 2026.
| Public test app | Pinned commit | Classes found, of those in our test plan | Safe controls that raised an alert | Run layer |
|---|---|---|---|---|
| crAPI: REST API with a shop, coupons and a store credit | b5fc307f3e5f |
5 of 5 | 0 of 5 | Full engine: proof stored per finding, signed ledger |
| VAmPI: REST API (Flask) | f16052dce83f |
5 of 5 | 0 of 5 | Recipe layer, then the full engine with a signed ledger |
| DVGA: GraphQL API (Flask) | a961308c02d1 |
6 of 6 | 0 of 6 | Recipe layer (no ledger on this run) |
| Total | 16 of 16 | 0 of 16 |
- 16 of 16 classes confirmed by running the exploit (crAPI 5 of 5 · VAmPI 5 of 5 · DVGA 6 of 6), with 0 of 16 safe controls raising an alert.
- 3 of 3 money flaws proven on crAPI, each with a stored proof in a signed ledger of 35 hash-chained events.
- Recall is per app, against the classes in our test plan for that app, not against every weakness the app documents. crAPI documents 18 challenges; this run attempted 4 of them and confirmed all 4. The others were not attempted, so they count neither as found nor as missed.
Definitions, pinned versions and misses: how we measured.
Try it: one command, a real proof
The demo boots a fictional vulnerable app, attacks it, and checks that the safe version of each feature stays quiet. Offline, no AI key, no spend.
git clone https://github.com/xtarwall/xwatch
cd xwatch
node --experimental-strip-types demo/run.ts
It prints the proven attacks and the false alarms, then PASS (or exits non-zero on any failure).
Install
Requirements: Node.js 22.6 or newer and git 2.40 or newer.
npx -y @xtarwall/xwatch mcp # run it without installing
npm install -g @xtarwall/xwatch # or install the `xwatch` command
xwatch --help
Or use the one-line installer shown at https://xtarwall.com/watch/.
From a clone of this repository: run npm install once, then node --experimental-strip-types bin/dh.ts mcp
(TypeScript runs through Node's type stripping). npm run build writes the compiled JavaScript to dist/.
Add it to Claude Code (Codex and Cursor are in Add it to your coding agent below):
claude mcp add xwatch --scope user -e DH_MCP_ALLOWED_ROOTS="$HOME/code" -- npx -y @xtarwall/xwatch mcp
Point it at your app
- Ask your agent to scan your changes. With nothing else set, you get a change summary and passive findings.
- Describe what to check:
DH_CANDIDATES(your candidate list) andDH_TARGET(the target your grants name). - To allow active tests on that one target: a live scope grant in
DH_GRANTS, andDH_MCP_ACTIVE_CONSENTset to exactlyDH_TARGET, confirming written authorisation (CONSENT.md).
Every variable is in Environment below.
Upgrade: XGuard and XShield
XWatch runs where you run it. The paid tiers run it for you, and go further:
- XGuard: proof on every push. Attacks a short-lived copy of your app (never production) across all your repos, writes the fix, and keeps a signed, hash-chained record of each finding that you can re-check.
- XShield: everything in XGuard, plus a wall around your live app: known attacks blocked, repeat sources slowed, decoy keys that alert when touched. Starts in observe mode; alerts at any hour.
Compare plans on xtarwall.com/pricing.
What it doesn't cover yet
XWatch is not the full engine: no hosted checks on every push, no live protection, and its findings output is redacted (no proof-of-concept, only a digest prefix). The harness behind the numbers above and the ledger verifier are not public yet. None of those results come from a customer's app. All stated gaps.
Add it to your coding agent
Every agent runs the same command, xwatch mcp (or npx -y @xtarwall/xwatch mcp without a global install).
DH_MCP_ALLOWED_ROOTS limits which folders may be scanned; set it to where your code lives.
Claude Code:
claude mcp add xwatch --scope user -e DH_MCP_ALLOWED_ROOTS="$HOME/code" -- npx -y @xtarwall/xwatch mcp
Codex:
codex mcp add xwatch --env DH_MCP_ALLOWED_ROOTS="$HOME/code" -- npx -y @xtarwall/xwatch mcp
Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project), and any other MCP client that takes a JSON config:
{
"mcpServers": {
"xwatch": {
"command": "npx",
"args": ["-y", "@xtarwall/xwatch", "mcp"],
"env": { "DH_MCP_ALLOWED_ROOTS": "/path/to/your/code" }
}
}
}
Configs written for 0.1.x that run xtarwall-watch mcp keep working: the alias runs the same program.
The four tools
| MCP tool | A2A skill | What it does |
|---|---|---|
xtarwall_scan_changes |
scan_changes |
Lists staged, unstaged and untracked changes in a local repo (against HEAD or the merge-base of baseRef), finds which configured candidates the change reaches, assesses them and returns four-state findings plus the signed-ledger check. Arguments: repoPath (absolute local path), baseRef?, paths?, active?. |
xtarwall_get_findings |
get_findings |
The last scan's findings, redacted: no PoC, no target, no evidence; only a 16-hex-character prefix of the proof digest. |
xtarwall_explain_finding |
explain_finding |
One finding (id like f1): what its state means, the CWE, what to do next. |
xtarwall_status |
status |
Model mode and vendor, which model key variables are set (names only, never a value), the run budget, candidates, grants, whether active tests are allowed, the ledger. |
Findings have four states: Confirmed (a test actually reproduced it, with proof), Suspected, No issue and Not assessed. Only Confirmed is an alert.
Passive by default; active tests need consent per target
Nothing is executed against anything unless all of these hold:
- the agent calls
xtarwall_scan_changeswithactive: true; - you set
DH_MCP_ACTIVE_CONSENTto exactly the value ofDH_TARGET(your confirmation that written authorization for that one target is signed and the owner has a backup; see CONSENT.md); DH_GRANTSholds a live active scope grant for that target.
Otherwise every grant is capped at passive: the result is Suspected or Not assessed. Active tests run only against the ephemeral copy that your candidate's provisioner names. Tool arguments can narrow a scan but cannot grant scope: target, grants, candidates and keys come only from the environment you set.
Repo access is confined: repoPath must be an absolute local path in a git work tree (URLs and git@host: remotes
are refused), symlinks that leave the repo are dropped, and DH_MCP_ALLOWED_ROOTS narrows which folders may be
scanned. Git runs without a shell, with hooks, fsmonitor, filters, textconv and global config off, and a timeout.
Your own AI key
XWatch calls the model provider you choose, with your key, from your machine. Supported providers:
| Provider | Key variable (or <NAME>_FILE with an absolute path to a key file, preferred) |
Model id example |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY |
claude-haiku-5-5 |
| OpenAI | OPENAI_API_KEY |
openai:gpt-5-nano |
| Google Gemini | GEMINI_API_KEY |
gemini-3.5-flash-lite |
| Groq | GROQ_API_KEY |
groq:openai/gpt-oss-20b |
XTARWALL_MODEL_CHEAPandXTARWALL_MODEL_FRONTIERpick the model for each tier as[vendor:]model. Left unset, XWatch uses the defaults of the first provider that has a key (Anthropic, OpenAI, Google, then Groq).- A paid call also needs
DH_RUN_BUDGET_CENTS(whole cents per run). Without it every paid call is refused before the provider is called, so nothing is spent. - Models are priced from a dated table. For a model the table does not know, set
XTARWALL_MODEL_CHEAP_PRICE/XTARWALL_MODEL_FRONTIER_PRICEto"<in $/1M>,<out $/1M>"; without a price an unknown model is refused. - A vendor-neutral
DH_MODEL_API_KEY(orXTARWALL_MODEL_KEY_FILE) is used only when every tier names the same vendor, so a key is never sent to another vendor's host. There is no base-URL variable: hosts are fixed. - With no key set, every model call goes to an offline mock and costs nothing.
xtarwall_status shows which vendor and models are in use and which key variables are set, never their values.
Environment
| Variable | Meaning |
|---|---|
DH_CANDIDATES |
Absolute path to a module that export defaults your candidate list (needs DH_TARGET). For the shape, see the test fixture. Without it a scan is a change summary only. |
DH_TARGET |
The scope target your grants name. Shown only as a sha256 prefix. |
DH_GRANTS |
Absolute path to a JSON array of {orgId, target, tier, expiresAt} scope grants. |
DH_MCP_ACTIVE_CONSENT |
Set to the exact DH_TARGET to allow active tests on it. |
DH_RUN_BUDGET_CENTS |
Run budget in whole cents (unset = no paid model call). |
DH_ORG_ID, DH_APPLICATION_ID |
Ledger ids (defaults local, local-repo). |
DH_KEY_DIR |
Absolute key directory for a persistent ledger signing key. |
DH_MCP_LEDGER_DIR |
Absolute directory (outside the repo) to also write each run's sealed chain. |
DH_MCP_ALLOWED_ROOTS |
:-separated absolute folders that may be scanned. |
A .ts module in DH_CANDIDATES is loaded by your own Node, so it needs a Node that strips types for files outside
node_modules (22.18+ or 23.6+ by default); a .js or .mjs module works everywhere.
Command line and CI
xwatch mcp # stdio MCP server (what coding agents run)
xwatch a2a serve [--host h] [--port p] [--allow-remote] # A2A 1.0 agent
As an A2A agent, for another agent or a CI job:
DH_A2A_TOKEN_SHA256_FILE=~/.xtarwall/a2a.sha256 xwatch a2a serve --port 8787
The Agent Card is at GET /.well-known/agent-card.json; JSON-RPC 2.0 is at POST /a2a/v1 with a bearer token whose
sha256 is in that file. It binds to loopback unless you pass --allow-remote. Clients send A2A-Version: 1.0.
In CI, start it in the job, call scan_changes on the checked-out repo, and fail the job on a Confirmed finding.
The package also ships SARIF 2.1.0 and pull-request comment renderers as library modules (dist/engine/src/report/).
This release has no command that writes SARIF or posts a PR comment for you; a CI script can import them.
Signed record
Every scan seals start and finish events (plus each assessment's own events) onto an Ed25519 hash-chained ledger and verifies the chain before answering.
Tests
npm test
Hosted plans
XWatch is free and open source. XGuard and XShield are the hosted, paid plans: https://xtarwall.com/pricing/.
Security and licence
Report a vulnerability in XWatch privately as described in SECURITY.md. Use XWatch only on systems you own or are authorized to test (CONSENT.md).
XWatch is licensed under the GNU Affero General Public License, version 3 only (AGPL-3.0-only). In plain words:
- Free to use and modify. Run it on your laptop, in CI or inside your coding agents, and change it as you like.
- Share your changes if you serve them. If you run a modified version as a service for other people (over a network, for example), you must publish your changes under the same licence. The same applies if you hand a modified copy to someone else.
- Commercial licences on other terms are available on request: email licensing@xtarwall.com.
LICENSE holds the full, binding text and NOTICE the copyright notice; this summary does not replace them.
XWatch is part of Xtarwall. An Xtarvrse company. Licence: AGPL-3.0.