Skip to content
SkilledDragonEngineering Intelligence
MinilabKeylessOctober 21, 2026

EdgeAgent found 43 errors in a loose Cloudflare agent fixture and 0 in the safe one

edgeagent reads a Cloudflare Agents project's wrangler config and Worker source and checks secrets, tools, egress, bindings and routes against a team policy. No wrangler, no deploy, no keys.

By David Discua

Measured in the lab

43
errors on loose-agent
0
errors on safe-agent
39
rules
55/55
upstream examples parsed
Secrets14
Bindings13
Egress11
Routes11
Tools10
Compat6
Config and package2
  • safe-agent passes, exit 0
  • loose-agent fails, exit 1, 32 rules hit
  • sk- shaped key in plain vars caught in both environments
  • MCP edgeagent_audit reports the same 43 errors as the CLI
  • 53 tests pass, 0 fail

From reports/edgeagent.json · run on October 21, 2026. 39 rules, wrangler schema 4.151.3, fixtures pinned to agents 0.28.1, every environment; the report carries no timestamp, generated_at is its file time

How it is wired

filespolicyfindingsAgent projectwrangler + Worker srcTeam policyallowlistsedgeagent39 rules, staticReportSARIF + exit code

01/03Your Cloudflare agent project sits on disk.

The Cloudflare agents SDK puts a long-running agent on the edge in a few lines, and nothing in that path asks whether the agent keeps a key in plain-text vars, calls domains nobody approved, or is public on *.workers.dev with no auth hook. edgeagent reads the project itself (wrangler config, the Worker TypeScript reachable from main, package.json, .gitignore) and checks it against a policy file your team tunes. On two fixtures with the same policy, the deliberately loose agent came back with 43 errors and the safe one with 0. The catch is that this is static analysis, so a passing project can still misbehave at runtime.

The catch

edgeagent uses the TypeScript parser without type information. Values built at runtime are reported as dynamic, not resolved. It follows relative imports from main only, so tsconfig path aliases and code inside node_modules go unscanned, and egress made by a dependency is invisible. A library that reads env.X for you makes that binding look unused until you list it in bindings.implicit. What a remote MCP server exposes at runtime cannot be known from source, which is why runtime tool sources get their own rule. A clean report does not block egress or tool calls, and it does not check that your auth hook is correct.

The loose fixture is written to fail. Its credentials are fake (sk-EXAMPLE-...), and it exists to exercise the rules.

What we ran (keyless)

bun install --frozen-lockfile
bun run src/cli.ts audit fixtures/safe-agent  --policy fixtures/team.policy.jsonc
bun run src/cli.ts audit fixtures/loose-agent --policy fixtures/team.policy.jsonc --env "*"
bun run report

From reports/edgeagent.json, run on October 21, 2026, every environment:

FixtureExitErrorsWarningsNotesRules hitBindingsToolsCallablesEgress hostsDynamic egress
safe-agent0001132110
loose-agent1432133294223

The loose agent's errors include vars.OPENAI_API_KEY holding an sk- shaped value in both the default and env.staging environments, four AI SDK tools missing from tools.allow (fetchUrl, postToPaste, chargeCard, emailReport), a @callable() method named wipeEverything, fetch calls to two domains outside egress.allow, one of them over plain http://, and workers_dev = true. Its [env.staging] block forgets its bindings, which shows up as code reading env.DB and env.AI with nothing declared. The safe agent's single note is that process.env is populated under nodejs_compat. The MCP tool edgeagent_audit over stdio returned the same 43 errors as the CLI.

We also ran the analyzer over a local clone of cloudflare/agents at commit b1e3614bb0ad. All 55 example projects parsed without a config or parse error, covering 130 Worker source files, 143 bindings, 84 tools and 201 @callable methods. The examples are demos that run on workers.dev without auth on purpose, so those findings are analyzer output under an empty policy, not vulnerabilities.

How it is wired

The CLI parses wrangler config in JSON, JSONC or TOML, checks named environments separately (wrangler does not inherit bindings, vars or secrets into [env.*]), and reads the list of valid keys from wrangler 4.151.3's own schema, which is how it catches a kv_namespace typo. It never runs wrangler, deploys, or calls the Cloudflare API. Output is text, JSON, Markdown or SARIF, and the same checks are exposed through a read-only MCP server.

Minilab (open source)

The fixtures follow the example conventions of cloudflare/agents (5,880 stars, MIT, TypeScript, as of October 24, 2026), pinned to agents 0.28.1. Point bun run src/cli.ts init at your own agent to get a starter policy, then run bun run report and compare against reports/edgeagent.json.

Run it yourself

SkilledDragonCorp/edgeagent-policy-pack

Clone, install and run the report with no API keys. The numbers above are what that run writes.

bun install --frozen-lockfile && bun run src/cli.ts audit fixtures/loose-agent --policy fixtures/team.policy.jsonc --env "*"

SkilledDragon is not affiliated with Cloudflare, Inc. Numbers are from our own keyless lab run on fixtures written for the lab; re-run the report before relying on them. Marks belong to their owners.

All labs