Skip to content

Back to the catalog

RedAI
github.comrepo

RedAI

RedAI is a terminal-based AI security scanner that pairs LLM scanner agents (Claude Code or Codex) with validator agents that drive a live target environment — a real Chrome browser or an iOS Simulator, with a plugin interface for adding others like a Linux VM or Kubernetes cluster — to prove or disprove each candidate finding before it's reported. Each confirmed finding ships with evidence (PoC scripts, HTTP transcripts, logs, screenshots) rather than just a static-analysis guess, and the tool includes two intentionally-vulnerable demo apps (web and iOS) for trying the full discover-validate-report pipeline end to end.

TL;DR Open-source AI agent pipeline that scans code for vulnerabilities then validates each finding live in a browser or iOS Simulator, producing evidence-backed reports.
Document

What it is

RedAI (@kpolley/redai, MIT, npm-installable) is a Bun-based terminal tool. The summary covers the scanner+validator concept; what it omits is the concrete setup, the required credentials, and the local-state security footprint an operator should know before running it.

What to do

Install and run the bundled webapp demo end-to-end without pointing it at your own code:

bun install -g @kpolley/redai
cd examples/webapp && bun run dev      # http://localhost:3000
redai

In the TUI: create a Browser environment pointed at http://localhost:3000, sign in once with exampleuser / examplepassword, mark it ready, then start a scan against examples/webapp. A second bundled demo (examples/iosapp) exercises the iOS Simulator environment.

Local checkout alternative:

git clone https://github.com/kpolley/redai.git
cd redai
bun install
bun run redai

Exactly one scanner key is required, matching your chosen scanner. RedAI reads .env from the working directory; existing shell env vars take precedence:

ANTHROPIC_API_KEY=...   # Claude Code
OPENAI_API_KEY=...      # Codex

Reports land at ~/.redai/runs/<runId>/report.md (and .html); evidence and PoC artifacts under ~/.redai/runs/<runId>/artifacts/.

How it works

A scan needs two inputs: a source directory and a validation environment already marked ready (login done, correct initial state reached, app installed). Adding a new environment means implementing the interface in src/validators/validator-plugin.ts — the same interface the bundled Chrome (via agent-browser) and iOS Simulator (via xcrun simctl) plugins use; each handles its own setup/teardown and exposes tools to the agent. The full internal pipeline is nine stages (preflight, threat model, file prioritization, analysis units, unit scan, finding aggregation, validation plan, validation execution, reporting), collapsed into three visible phases:

flowchart LR
    D[Discover: triage source] --> V{Validate against live env}
    V -->|confirmed| R[Report + evidence]
    V -->|disproved| X[dropped]
    V -->|unable-to-test| R

Only confirmed findings carry proof (PoC, HTTP transcripts, logs, screenshots).

Caveats

  • Local state is sensitive. ~/.redai/ (override with REDAI_HOME) may hold source-derived prompts, agent transcripts, reports, evidence, credentials, browser profiles, and simulator metadata — treat the directory accordingly.
  • Authorized targets only; run against software you own or are permitted to assess.
  • The project itself states agent output can be incomplete or wrong — review findings and evidence before acting.

Technologies named here

Techniques named here

  • Scanner agent triage/probing of source code
  • Live environment validation of findings
  • Evidence collection and reporting