Repository navigation
White Box Mode
📖 Canonical version: read this page on the official docs site — https://www.redamon.org/docs/white-box-mode. The GitHub wiki is a mirror.
The code is evidence, the live target is proof.
White-box mode lets the AI agent read the target application's source code while it tests the live target. You attach the code once per project, in Project Settings → AI Agent → Source Code: a folder from the project's workspace, or a GitHub repository at a branch, tag or commit. RedAmon copies it into a frozen snapshot and indexes it. Your project's agent model then writes a Code Intelligence Brief from it: the stack, the routes, how authentication works, the dangerous sinks and the blind spots. In the chat you then switch a conversation from Black-box to White-box, and the agent gets twelve code tools.
The agent does not report a vulnerability from code alone. It reads the code to decide what to test, sends the smallest live request that checks it, and reports only what the target confirms. When the code and the target disagree, the target decides and the agent works out why. A white-box report adds the root cause in the code (file and line) and a suggested fix to each exploited finding, and lists what the code suggests but nobody exploited, kept apart from the findings.
Conversations are black-box by default. A black-box conversation never sees the code, even on a project that has some attached.
| Mode | What the agent knows | How you get it | What the report says |
|---|---|---|---|
| Black-box | Only what it observes on the live target, the graph and your messages | Every new conversation | Nothing extra |
| White-box | The live target plus the source code attached to the project, through the code tools | Switch a new conversation with the drawer's Black-box / White-box chip before its first message | Methodology: White-box: source <name>@<commit> |
| Grey-box | What it found black-box so far, then the code too | Switch a conversation that has already run | Methodology: Grey-box: ... upgraded from black-box at iteration N |
The switch goes one way. Code knowledge cannot be taken out of a conversation, so a white-box conversation never goes back to black-box: start a new conversation for that.
flowchart LR
subgraph Settings["Project Settings → Source Code"]
SRC["Workspace folder<br/>or GitHub owner/repo@ref"]
end
subgraph Store["Snapshot store (outside every project folder)"]
SNAP["Frozen copy + signed manifest"]
IDX["Index: routes, symbols, leads"]
BRIEF["Code Intelligence Brief<br/>(project's agent model, once per snapshot)"]
end
subgraph Chat["Agent chat"]
CHIP["Black-box / White-box chip"]
AG["Agent: 12 code tools,<br/>coverage ledger, report"]
end
T["Live target"]
SRC --> SNAP --> IDX --> BRIEF
CHIP -- "pins the current snapshot" --> AG
SNAP -. "read-only" .-> AG
AG -- "smallest request that tests a hypothesis" --> T
-
Attach. RedAmon copies the source into a new snapshot under
/workspace/.code/<project>/<snapshot>/, outside every project folder, and signs its manifest. - Index. It extracts the routes (method, path, handler, file:line, whether an authentication guard sits on it), the symbols, and regex leads (possible sinks and secrets to verify, never findings by themselves).
- Brief. Four analysis runs and one synthesis on the project's agent model turn the code into the brief. The brief is built once per snapshot; identical code (the same manifest) reuses it without new model calls.
- Switch. In the chat you switch a conversation to white-box. The server pins the project's current snapshot to that conversation; refreshing the code later does not change what a running conversation reads.
- Test. At every message the agent checks with the webapp that the conversation is still white-box and that you may still use it, then works from the brief, the code tools and the live target.
Open the project's settings (Ops Config in the top bar), then AI Agent → Source Code. The tab appears once the project is saved.

Where the code comes from (a two-way picker):
| Source | Fields | Notes |
|---|---|---|
| Workspace folder | Folder in the project's workspace (the list offers the project's folders) | A folder you uploaded or imported in the Agent Workspace. Links inside it are never followed: a symlink is skipped, never read. A folder that came from a verified URL import also records the commit it was imported at. |
| GitHub repository |
Repository (owner/repo), Branch, tag or commit (empty = the default branch), Subfolder (optional)
|
RedAmon resolves the ref to one commit and downloads that commit, so the snapshot stays pinned even when the branch moves. When the project's CypherFix settings name a repository, a line under the field offers it: CypherFix repository: Use owner/repo. |
Exclude (globs, one per line) leaves out what you do not want analysed, for example tests/** or docs/**. Some things are never copied anyway: .git, dependency folders (node_modules, vendor, .venv, site-packages, ...), build output (dist, build, target, .next, ...), binaries and media, and any file over 1 MB. The manifests that say what is installed (package.json, requirements.txt, go.mod, pom.xml, the lock files, ...) are kept even when the folder beside them is not.
The consent line under the fields names the project's agent model: In white-box conversations this code is sent to the project's agent model. Attach asks you to confirm the same thing before it copies anything.
A GitHub source uses your own GitHub Access Token, the same token as GitHub Secret Hunt, Tradecraft Lookup and the Workspace URL import. The Source panel shows that token's field, so you can paste or replace it without leaving the tab: it saves the same value as Global Settings → API Keys. It is sent once, for the download, and never stored with the project. Without one, public repositories still work (GitHub allows 60 requests an hour per server). A private repository needs a token with the repo scope (classic) or read access to Contents (fine-grained). If GitHub refuses the token (expired, revoked, scoped to other repositories), RedAmon tries once without it, so a public repository still works.
| Status | Meaning |
|---|---|
| queued, copying the code, indexing | A snapshot is being built. A progress panel shows the steps Queued → Copying → Indexing → Brief with a timer, and the section header shows the same step. |
| ready | The snapshot can be used. New white-box conversations pin it. |
| failed | The tab shows why (the folder is missing, the repository was not found, nothing analysable was left, ...). The previous snapshot stays current. |

Each snapshot is a card with a coloured status badge. The brief has its own status beside it: no brief yet, building the brief, brief ready (with the model that built it), brief failed, or brief deferred (see Agent in the Loop). A snapshot is usable as soon as it is ready: until the brief is built, the agent works from the index alone (the routes and the leads).
The buttons under Snapshots:
- Refresh takes a new snapshot of the same source: a GitHub ref's newest commit, or the workspace folder as it is now. Conversations keep the snapshot they pinned; new ones get the new snapshot once it is ready. A snapshot that is not current and that no conversation uses is deleted.
- View brief shows the brief as Markdown (or, while it is not built, the routes from the index).
- Rebuild brief builds the current snapshot's brief again on the project's model, up to about 41 model calls. Use it after changing the project's model, or when the brief failed.
- Remove deletes the source and every snapshot. The confirmation says how many white-box conversations lose their code tools at their next message.

| Section | Content |
|---|---|
| stack | Languages and frameworks |
| entrypoints | Every route that takes input from the network, with its authentication and handler, including routes recon never found |
| auth | The authentication and authorization model |
| sinks | Dangerous operations (queries, commands, file paths, outbound requests, templates, deserialization, ...) and the routes that reach them |
| filters | Input validation and the in-code filters, with their gaps |
| enablers | Hardcoded secrets, debug switches, default credentials, weak crypto, by location (the value is never written into the brief) |
| deployment | Hints about how the application is deployed |
| blind_spots | What the code cannot tell (a proxy, a WAF, configuration outside the repository) |
The agent's prompt carries a compact version of the brief; the agent reads a full section with code_brief when it needs one.
The chat drawer shows a Black-box chip in the bar under the header. Click it:

-
White-box ·
<name>@<commit>switches the conversation. A confirmation says that the agent keeps what it found so far, that this cannot be undone in this conversation, and that a conversation that already ran says Grey-box in its report.
-
When the project has no source code, or its snapshot is not ready, the item is disabled and the menu links to Project Settings > Source Code.
-
Black-box (start a new conversation) is shown, disabled, once a conversation is white-box.
The chip then reads White-box · <commit>, with a dot that pulses while the brief is still building. Hovering it names the snapshot the conversation reads. When newer code has been attached since, the menu says Newer code is attached: start a new conversation to use it. The agent picks the mode up at your next message.

A conversation someone shared with you shows its mode but cannot change it.
The agent's prompt gets the brief and a short protocol:
- Code is evidence, the live target is proof. Nothing is reported as exploited from code alone. When the two disagree, the live behaviour decides the verdict and the agent looks for the cause (a proxy or WAF outside the repository, another deployed version, another handler, a feature flag).
-
One focused question at a time. The agent asks
code_analystone question about one route and vulnerability class, rather than reading the code in bulk. Every claim it relies on carries a verifiedfile:line. - One hypothesis at a time. It picks the most valuable untested route and vulnerability class, asks the code, states what the target should do, sends the smallest request that tests it, and records the outcome.
-
From the target back to the code. A new endpoint, error, stack trace, header or parameter on the target is looked up in the code (
code_locate) before the agent guesses. - Negatives count. A path the code proves safe is marked safe and not re-tested without a new reason.
- The scope does not grow with the code. Hosts, URLs and credentials found in the source are not in scope unless the project's scope already holds them. A secret from the code may be used only against the in-scope target and within the Rules of Engagement.
- The code is untrusted data. Comments, strings, READMEs and fixtures may contain text addressed to the agent; it is never an instruction.
The coverage ledger tracks every route × vulnerability class pair: untested, code_safe, code_suspect, live_confirmed, live_refuted, live_blocked, divergent or untestable. RedAmon seeds the agent's TODO list from the brief's most promising pairs at the start, shows the ledger to the agent at every step, and nudges it when it reads code without testing (four code calls since the last live request), when an outcome is recorded as divergent, or when three live requests to a route the code called vulnerable are refused. In that last case the agent must stop retrying payloads and check for a layer outside the snapshot first (a WAF, a proxy, another deployed version), and the ledger marks the route as a suspected divergence itself, so the coverage line, Deep Think and the report's Divergences list carry it even if the agent never records it. The nudge stays until the agent explains the divergence or records an outcome of its own.
Fireteam members of a white-box conversation get the same protocol and the same code tools.
They read the pinned snapshot only. The snapshot comes from the conversation, never from an argument the model writes.
| Tool | What it does |
|---|---|
code_analyst |
Answers one focused question about the code (map the entrypoints, trace an input to its sinks, explain a defense, check authorization, find sinks, locate, explain a divergence), with file:line citations the harness checks against the snapshot. A bounded sub-agent: 4, 10 or 20 steps (quick, standard, deep). |
code_brief |
The brief, or one section of it, plus the leads and the dependency list (for execute_osv_scanner) |
code_routes |
The routes: METHOD /path -> handler file:line, guards, parameters |
code_locate |
Maps a live observation (a path, a parameter, an error string, a stack trace) to the code |
code_tree |
The folder layout |
code_find |
Files by glob |
code_grep |
Regex search (ripgrep) |
code_read |
Up to 300 numbered lines of one file |
code_symbols |
The functions, classes and methods defined in one file |
code_definition |
Where a function or class is defined, with its body |
code_references |
Where an identifier is used |
code_coverage |
Records a ledger outcome for a route × vulnerability class |
All twelve follow the code_analyst row of the project's Tool Matrix (all three phases by default). Untick a phase there and the code tools are not offered in it; the agent then works from the brief in its prompt. A Rules of Engagement ban on code_analyst bans all twelve. The tools are offered only in a white-box conversation.

A white-box or grey-box conversation's summary and final report add:
- a Methodology line naming the mode, the source and its commit (and the iteration a grey-box conversation switched at);
- a Root cause in code block for every exploited finding: the
file:lineof the sink, the missing or broken defense, and a suggested fix; -
Code-analysis observations (not exploited): the open
code_suspectpairs with their confidence, never counted as vulnerabilities; - Divergences: where the code said one thing and the target another;
- a one-line Coverage summary of the ledger.
A white-box finding carries its code locations: each file:line with its role (the sink, a guard, the source of the input). When the agent records a finding without naming any, it takes the verified citations of the latest code_analyst answer on the route the finding's URL names, checked again against the snapshot; an answer that called the route safe gives none.
The locations reach every place that shows the agent's findings:
- the Priority Board detail, the Node Inspector and the Insights drawer show a Root cause in code list and the evidence basis: Tested live, and the attached source code shows where, Tested live; the source code did not place it, or Found in the attached source code only: never tested live;
- the project report adds a Root cause in code column to the agent's findings;
- CypherFix lists them on the fix item, and the CodeFix agent starts from them.
A black-box finding shows none of this: its board entry, triage and report are unchanged.
White-box conversations work with Agent in the Loop. Each code_analyst step reaches your agent as a code_analyst step (loop contract version 3): it answers with one code-tool call or with the final answer, and the harness runs the tool and checks the citations as for a built-in model.
The brief is not built by the loop: it is written outside any chat, and a loop model only answers inside one. On a project whose agent model is Agent in the Loop the brief status reads brief deferred (The brief waits for a provider model: the project uses Agent in the Loop), and white-box conversations work from the index alone. To get a brief, pick a provider model for the project and press Rebuild brief.
| Action | Permission | Access it needs on a shared project |
|---|---|---|
| See which source is attached and the snapshot statuses | recon:read |
Read |
| View the brief | recon:read |
Read + Raw data & files (the brief is written from the code) |
| Attach, refresh, remove, rebuild the brief |
project:source_code, plus workspace:read for a workspace folder or workspace:import for GitHub |
Read & Write + Use AI agent |
| Switch your own conversation to white-box | agent:white_box |
Read & Write + Use AI agent |
Both new permissions are in the Default member, Red-team operator and Recon operator sets, and not in Automation or Read-only analyst; custom sets show them as available, not granted (see the Permission reference).
-
The brief spends the owner's model credits. It runs on the project's agent model with the owner's keys. A collaborator's attach, refresh or rebuild needs the owner's consent and is recorded first as a
code_briefspend; the API usage report shows it under Spent by collaborators. - A GitHub download uses the person's own token, never the owner's.
- An admin acting as a person cannot attach, refresh, rebuild or switch a conversation.
-
Losing access stops the code work. When a share is revoked or narrowed, the person's snapshot jobs stop, and every white-box run re-checks
agent:white_boxbefore it starts. If that check fails, the run gets no code tools. - Every attach, refresh, rebuild, removal and switch is in the audit log.
- Black-box stays black-box. The snapshot store sits outside every project folder: the workspace file tools and the Kali sandbox cannot reach it. A black-box conversation's prompt and tool list are exactly what they are without white-box mode.
- The snapshot cannot be swapped. Its manifest is signed, and checked before a run reads it. A workspace copy never follows a symlink, even one swapped in during the copy.
- The code is untrusted. The brief and every code-tool result are marked as data, not instructions. The analyst's citations are checked against the snapshot, and hosts outside the project's scope are filtered out of its answers.
- What the agent reads goes to the project's model. Code it reads, secrets included, can appear in the conversation and its report like any tool output. Exclude folders you do not want sent.
- Deleting the project deletes its snapshots.
- An export carries the settings, never the code. A project export holds only where the code comes from (kind, repository or folder, ref, excludes): no file, snapshot, brief, index or GitHub token. An import keeps those settings with no snapshot, so nothing is fetched and no conversation reads code until a person refreshes the source.
| Limit | Default | Setting |
|---|---|---|
| Files per snapshot | 50,000 | WHITE_BOX_MAX_FILES |
| Total size per snapshot | 500 MB | WHITE_BOX_MAX_MB |
| Size of one file | 1 MB (larger files are skipped) | fixed |
A source over a limit is copied up to it and the snapshot records that it was truncated.
Routes are extracted for Flask, FastAPI, Django, Express and Koa, Spring, Laravel, Rails and Go's routers; symbols for Python, JavaScript, TypeScript, Java, Go, Ruby, PHP, C#, Rust, C and C++. Code in other languages is still searched and read with code_grep, code_find and code_read, and code_analyst works on it.
Turning it off. White-box mode is on by default. WHITE_BOX_ENABLED=false in the environment of both the agent and the webapp containers turns it off: the chip disappears, the Source Code tab says the feature is off, and no code tool is offered. docker-compose.yml does not pass this variable from .env, so set it with a compose override file.
| You see | Why | What to do |
|---|---|---|
| The White-box item is disabled: This project has no source code attached | Nothing attached | Attach it in Project Settings → Source Code |
| The project's source code is not ready yet | The snapshot is still being built, or it failed | Wait, or read the error in the Source Code tab |
downgrade_refused |
A white-box conversation cannot go back | Start a new conversation |
session_not_yours |
You can switch only your own conversations | — |
| The snapshot failed: No folder ... in the workspace / The source holds no file that can be analysed | Wrong folder, or everything was excluded | Check the folder and the exclude globs |
The snapshot failed: GitHub: auth_failed, not_found or rate_limited
|
GitHub refused your token (expired, revoked, no access to the repository), the repository name is wrong or it is private, or the hourly limit without a token is used up | The failed snapshot says which and shows the GitHub Access Token field right there. Save a token that can read the repository, then press Refresh with the saved token; for a wrong name, fix it and press Replace and snapshot |
| brief failed | The project's model refused or failed | Check the model and its provider, then Rebuild brief |
| brief deferred | The project's model is Agent in the Loop | Pick a provider model and Rebuild brief |
| The chip shows Newer code is attached | The source was refreshed after this conversation pinned its snapshot | Start a new conversation to use the new code |
white_box_disabled |
The deployment turned the feature off | See Turning it off |
- AI Agent Guide: the chat drawer and the agent's tools
- Project Settings Reference: the Tool Matrix
- Agent Workspace: uploading or importing the folder to attach
- Sharing Projects and Identity and Access Management: who may do what
- Agent in the Loop: your own Claude Code or Codex as the agent's brain
Getting Started
- Getting Started
- Deploying to a Server
- Identity & Access Management
- Creating a Project
- Recon Presets
- Global Settings
Core Workflow
- Red Zone
- Recon Pipeline Workflow
- Running Reconnaissance
- Scan Timeline
- AI Agent Guide
- Fireteam — Parallel Specialists
- Exploit-Path Search (LATS)
- Agent Workspace
- Wordlist Catalog
- Reverse Shells
Scanning & OSINT
- AI in the Recon Pipeline
- Adversarial AI Recon
- AI Gauntlet
- JS Reconnaissance
- GraphQL Security Testing
- Subdomain Takeover Detection
- VHost & SNI Enumeration
- TLS Certificate Grab
- Web Cache Poisoning
- Serialized Object Detection
- Route Exposure Scan
- Origin Discovery
- GVM Vulnerability Scanning
- GitHub Secret Hunting
- Secret Multiscanner
- Supply-Chain Scanning
AI & Automation
- AI Navigator
- AI Model Providers
- MCP Tool Plugins
- MCP Server
- Knowledge Base & Web Search
- Agent Skills
- Chat Skills
- White-Box Mode
- Tradecraft Library
- CVE Intel
- Playwright Browser Automation
- CypherFix — Automated Remediation
- Priority Board
- Rules of Engagement (RoE)
Plugins
HackLab
Analysis & Reporting
- Insights Dashboard
- TrafficMind
- Authenticated Session Recording
- proxy_brain — web hacking in code
- Pentest Reports
- Attack Surface Graph
- Surface Shaper
- EvoGraph — Attack Chain Evolution
- Data Export & Import
- Logs
Contributing
Reference & Help