# How to audit a production repo with deepsec and Brick

Vercel's DeepsecBench (July 2026) shows frontier models find the most vulnerabilities but cost up to $5,600 per production repo scan. Open-weight models score mid-tier at a fifth of the cost. This guide shows how deepsec + Regolo's Brick router sends easy files to cheap open models and hard ones to frontier — cutting audit costs 40–60% and balancing the different deepsec stage (revalidate, triage) using the right model to solve the right prompt complexity.

---

## What deepsec does (and what it doesn't)

Most security review tools only run on pull requests. That means everything written six months ago, two years ago, or by the engineer who left last quarter was never reviewed by today's models. deepsec starts from the opposite assumption: the existing code is the risk, not the last commit.

The pipeline has two stages: first, a local regex scanner (~110 built-in matchers) sweeps the repo and flags "candidate" files — authentication helpers, database queries, file upload handlers, secret references, anything that touches a security-sensitive path. This pass costs nothing in model tokens. It takes seconds on a few thousand files. Then coding agents investigate each candidate: they trace data flows, check whether a mitigation already exists upstream, and write a finding with severity, explanation, and a suggested fix.

After the agents finish, a cleanup phase kicks in. `revalidate` sends a second agent back to each finding to confirm it is a true positive, a false positive, already fixed in git history, or uncertain. `triage` sorts by severity. `enrich` adds committer metadata. `export` produces markdown or JSON, ready for tickets or for other agents to pick up.

![](https://regolo.ai/wp-content/uploads/2026/08/image-3-1024x470.png)[Credits to Vercel – DeepsecBench](https://vercel.com/blog/deepsecbench-evaluating-model-performance-in-finding-cybersecurity-vulnerabilities)

It also works best on applications and services — web apps, APIs, worker processes, anything with authentication, database access, or external integrations. Point it at a library-only package and you will get generic, low-signal findings. The tool is built for code that handles real user data and real money.

---

# Getting Started with Deepsec + Brick (local and API)

The official deepsec docs recommend Vercel Sandbox for fan-out and AI Gateway for model access, both require your code — or at least your workspace tarball — to touch Vercel infrastructure.

### For teams with strict network policies or a preference for keeping everything on-premises, that is a non-starter.

With Regolo API you can use GLM5.2 that got a score to position at 16 and 17.

![](https://regolo.ai/wp-content/uploads/2026/08/score-deepsec-1024x173.png)### **Local mode — self-hosted Brick**

You run Brick in a Docker container on your machine, Brick intercepts every model call from deepsec, classifies the prompt's complexity (easy, medium, hard) and capability vector (context depth, reasoning, code density, tool calling, direction-following, multilingual), then forwards to the best model in a pool you configure.

That pool can include open-source models hosted locally or via Regolo, Claude through Anthropic's API, OpenAI models, or any OpenAI-compatible endpoint. The routing decision stays on your machine. Only the final model call leaves your network.

You configure deepsec's two agent backends to point at the local Brick container:

- Backend `claude` (Anthropic SDK): Brick intercepts and routes to Claude or any model in the pool.
- Backend `codex` (OpenAI SDK): use `brick` as the model name. Brick classifies and forwards.

**Cloud mode — hosted Brick Complexity Pro.** You point deepsec at Regolo's hosted endpoint (`https://api.regolo.ai/v1`) and use `brick-complexity-pro` as the model. Brick Complexity Pro is the production router: it receives every prompt, classifies it, and dispatches to one of the models in Regolo's hosted pool.

The trade-off is simple: local mode gives you full control over the model pool and keeps routing decisions on your machine, at the cost of Docker setup and pool configuration. Cloud mode is one environment variable and gives you published pricing ($0.12 per 1M input, $0.46 per 1M output for Brick Complexity Pro), but the routing targets are fixed to what Regolo hosts.

Both modes work with the Docker parallelisation described later in this guide. The only difference is the base URL: `http://localhost:18000/v1` for local, `https://api.regolo.ai/v1` for cloud.

---

## Prerequisites

- **Node.js 22+.** Check with `node -v`.
- **Docker.** You need it to self-host Brick (local mode) and to run parallel deepsec containers (both modes).
- **A Regolo.ai API key.** Create one at `https://api.regolo.ai`. The same key works for both modes: it authenticates the self-hosted Brick container (which proxies to Regolo) and the hosted Brick Complexity Pro endpoint directly.
- **A checkout of the monorepo** you want to scan, on a trusted machine. deepsec is a coding agent with shell access — treat it like giving an intern root on whatever host it runs on.
- **Do not use a Claude Pro or ChatGPT Plus subscription** for this workflow. Subscriptions hit 5-hour and weekly rate limits long before a monorepo audit finishes, and Docker containers cannot reuse a local CLI login. You need API access through Regolo.ai.

Model spend is the large bill, with Brick routing, cost per file drops because easy files hit cheaper models. Baseline estimates without routing, for reference:

| Candidate files | Cost without Brick routing | Estimated with Brick | Native local wall time |
|---|---|---|---|
| 100 | $25–60 | $10–30 | 5–15 min |
| 500 | $130–300 | $55–150 | 25–60 min |
| 2,000 | $500–1,200 | $200–600 | 1.5–4 hr |

The Brick column is an estimate based on the typical distribution of easy/medium/hard files in a SaaS codebase — roughly 60% easy, 25% medium, 15% hard. Your mileage will vary. Calibrate with `--limit` before you open 8 containers.

---

## Step 1 - Scaffold the workspace

From the **monorepo root**, not from an app subpackage:

```
cd /path/to/northline
node -v   # needs 22+
npx deepsec initCode language: Bash (bash)
```

`init` creates a `.deepsec/` directory, installs dependencies, and asks how you want to pay for model calls. For a local Docker audit, stop after scaffold if `init` offers to launch a full `process`. You are about to configure Brick and fan out across containers.

To scaffold with a hard cap:

```
npx deepsec init --max-cost-usd 20 --max-duration 30mCode language: Bash (bash)
```

If the run is interrupted, out of quota, or hits the cap: run the same `init` again. It resumes from where it stopped.

`.deepsec/` is isolated on purpose — it has its own `pnpm-workspace.yaml` with empty workspaces so the parent monorepo does not swallow it as a package. Check in config files and `INFO.md` to version control. Findings under `data/` stay gitignored.

## Step 2 - Self-host Brick in Docker

This step is for **local mode** only. If you are using cloud mode (Brick Complexity Pro via Regolo API), skip to the next section.

Brick is an open-source Mixture-of-Models routing gateway. It reads each prompt's capability and complexity, then routes it to the best backend in a pool of open-source and commercial models, the source code lives at [`github.com/regolo-ai/brick-SR1`.](https://github.com/regolo-ai/brick-SR1)

Brick can run as a [hosted model on Regolo](https://regolo.ai/models/) directly, or as a self-hosted Docker container on your machine – self-hosting keeps the routing decision local and gives you a single endpoint for all deepsec containers to target.

Pull and run the Brick router:

```
docker run -d --name brick-router \
  -p 18000:18000 \
  -e REGOLO_API_KEY=sk-your-regolo-key \
  --restart unless-stopped \
  ghcr.io/regolo-ai/brick:latestCode language: Bash (bash)
```

Brick now listens on `http://localhost:18000`. It exposes two compatible endpoints:

- `/v1/chat/completions` — OpenAI-compatible, for the `codex` backend
- Anthropic-compatible message format, for the `claude` backend

Verify it is alive:

```
curl http://localhost:18000/v1/chat/completions \
  -H "Authorization: Bearer sk-your-regolo-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "brick-v1-beta",
    "messages": [{"role": "user", "content": "Is this SQL injectable: SELECT * FROM users WHERE id = " + user_input"}]
  }'Code language: Bash (bash)
```

You should get a response routed through whichever model Brick picked. If you see a connection refused, the container is not up. If you see a 401, your `REGOLO_API_KEY` is wrong or expired.

The Brick CLI is also available if you prefer managing routes explicitly:

```
git clone https://github.com/regolo-ai/brick-SR1.git
cd brick-SR1/apps/cli && npm install && npm run build && npm link
brick claude on    # route Claude-compatible traffic
brick codex on     # route Codex-compatible trafficCode language: Bash (bash)
```

For this guide, the Docker container is enough, the CLI matters if you want to swap the underlying model pool or add custom routing rules.

## Step 3 - Use Brick local and Deepsec

deepsec has two agent backends: `codex` (OpenAI SDK) and `claude` (Anthropic SDK). Brick is OpenAI-compatible, so you use the `codex` backend with Brick as the model. deepsec's preflight routine normally sets `OPENAI_BASE_URL` to the Vercel AI Gateway when it detects Gateway credentials. Without Gateway credentials, you set these variables yourself.

Create `.deepsec/.env.local`:

```
# Backend claude — Brick intercepts Anthropic-format requests
ANTHROPIC_BASE_URL=http://localhost:18000
ANTHROPIC_AUTH_TOKEN=sk-your-regolo-key

# Backend codex — Brick intercepts OpenAI-format requests
OPENAI_BASE_URL=http://localhost:18000/v1
OPENAI_API_KEY=sk-your-regolo-keyCode language: Bash (bash)
```

Run `process` using the `codex` backend with `brick` as the model name. Brick classifies each file and forwards to the appropriate model in the pool:

```
cd .deepsec
pnpm deepsec process --project-id northline --agent codex --model brick --limit 5Code language: Bash (bash)
```

For `revalidate`, use the `claude` backend. Brick routes to Claude or whichever model in the pool matches the capability vector:

```
pnpm deepsec revalidate --agent claude --model brick --min-severity HIGHCode language: Bash (bash)
```

For `triage`, back to `codex` with `brick`:

```
pnpm deepsec triage --agent codex --model brickCode language: Bash (bash)
```

If you want to override Brick for specific tasks — for example, forcing a frontier model for `revalidate` where accuracy matters more than cost — pass the model name directly:

```
pnpm deepsec revalidate --agent claude --model claude-opus-4-7 --min-severity HIGHCode language: Bash (bash)
```

Regolo serves open models through the same OpenAI-compatible endpoint, so `glm5.2` works as a model ID even on the `codex` backend. Brick is bypassed; you talk to the model directly.

---

## Why not just use brick-v1-beta (local mode)?

Local mode with self-hosted Brick works. It routes but requires you to configure and maintain the model pool, keep API keys for each provider current, and accept that the pricing is not published — you pay whatever each provider charges, and Brick does not aggregate billing.

Brick Complexity Pro (cloud mode) gives you:

- **Published pricing**: $0.12 per 1M input, $0.46 per 1M output. You can budget before the run, not after.
- **Pre-configured pool**: Claude and GLM-5.2 are live on Regolo, no pool setup required.
- **100K context**: enough for large files without chunking or truncation.
- **Tool calling and vision**: deepsec's agents use tool calls for file reads and shell commands. Brick Complexity Pro passes these through without stripping.
- **Mode control**: you decide whether each phase optimises for cost or quality. With the local beta, you get one mode (auto) and no override.

---

# Alternative setup: Brick via Regolo API (fastest)

## Use Brick API and Deepsec

Point both backends at Regolo's hosted endpoint. Brick Complexity Pro is the ingress model — it receives every prompt, classifies it, and routes to Claude or GLM-5.2 from Regolo's pool.

Create `.deepsec/.env.local`:

```
# Both backends point at Regolo's hosted endpoint
ANTHROPIC_BASE_URL=https://api.regolo.ai
ANTHROPIC_AUTH_TOKEN=sk-your-regolo-key

OPENAI_BASE_URL=https://api.regolo.ai/v1
OPENAI_API_KEY=sk-your-regolo-keyCode language: Bash (bash)
```

Run `process` using the `codex` backend with `brick-complexity-pro` as the model. Brick Complexity Pro routes each file to Claude (for hard prompts) or GLM-5.2 (for easier ones):

```
cd .deepsec
pnpm deepsec process --project-id northline --agent codex --model brick-complexity-pro --limit 5Code language: Bash (bash)
```

For `revalidate`, use the `claude` backend with Brick Complexity Pro. The router will dispatch hard findings to Claude:

```
pnpm deepsec revalidate --agent claude --model brick-complexity-pro --min-severity HIGHCode language: Bash (bash)
```

For `triage`, use `codex` with Brick Complexity Pro in eco mode:

```
pnpm deepsec triage --agent codex --model brick-complexity-pro:ecoCode language: Bash (bash)
```

You can bypass Brick and hit GLM-5.2 directly when you want its 1M-token context window for a specific file:

```
pnpm deepsec process --agent codex --model glm-5.2 --filter packages/billing --limit 10Code language: Bash (bash)
```

It is text-only, 744B parameters with 40B active per token, and handles long-horizon coding tasks well. Use it when Brick routes a file to it, or when you want to force a single-model pass on a large package.

---

## Use Regolo API with Brick Complexity Pro and Deepsec

[Brick](https://regolo.ai/introducing-brick-the-open-source-semantic-router-that-slashes-ai-costs-by-22x-while-hitting-world-record-performance-on-hugging-face/) Complexity Pro is the production model on Regolo's hosted API and available on our Huggingface repo: same routing engine, published pricing ($0.12 per 1M input tokens, $0.46 per 1M output — the lowest-priced model on Regolo), 100K context, tool calling, and vision support.

In cloud mode, that pool is fixed: Claude for hard prompts, GLM-5.2 for easier ones, in local mode, you configure the pool yourself — open-source models, Claude, OpenAI, or any combination.

## Four routing modes

| Mode | Behaviour | Best deepsec phase |
|---|---|---|
| `eco` | Minimum price per call. Routes to the cheapest model that can produce a valid response. | `triage` — sorting findings by severity, no deep reasoning needed |
| `balanced` | Quality follows capability. Routes to the model whose profile best matches the prompt's capability vector. Default mode. | `process` — the bulk of the audit, mixed complexity |
| `max` | Maximum quality routing. Picks the strongest model in the pool for every request. | `revalidate` — accuracy is the whole point, cost is secondary |
| `auto` | Dynamic with fallback. Picks a mode per request and falls back if the chosen model fails. | First run when you don't know the file complexity distribution yet |

## Configure deepsec for each phase with Brick Complexity Pro

Pass the mode as a suffix on the model name:

```
# process — balanced (default, mixed complexity)
pnpm deepsec process \
  --project-id northline \
  --agent codex \
  --model brick-complexity-pro:balanced

# revalidate — max (accuracy over cost, routes to Claude)
pnpm deepsec revalidate \
  --project-id northline \
  --agent claude \
  --model brick-complexity-pro:max \
  --min-severity HIGH

# triage — eco (cheap sort, routes to GLM-5.2)
pnpm deepsec triage \
  --agent codex \
  --model brick-complexity-pro:ecoCode language: Bash (bash)
```

In `max` mode, Brick Complexity Pro routes every revalidation prompt to Claude — the strongest model in the pool. In `eco` mode, it routes to GLM-5.2, which costs $2.31 per 1M input vs. Claude's higher rate. In `balanced` mode, it picks per prompt based on the capability vector.

---

## Step 4 - Write INFO.md like an attack-surface brief

Every AI batch receives `data/<project-id>/INFO.md` as context. The project ID defaults to the repo directory name. If your `INFO.md` is vague, your findings will be vague. This is where most teams fail — they either leave it empty or paste the entire architecture wiki into it.

You can let a coding agent fill it. Open the **parent** repo (not `.deepsec/`) and paste the prompt that `init` printed. That prompt tells the agent to read `.deepsec/node_modules/deepsec/SKILL.md`, then `data/<project-id>/SETUP.md`, then replace the placeholders with real context.

Or write it yourself. Keep it short — one page, not five. For a TypeScript SaaS monorepo, name the actual primitives an attacker would target:

```
# Northline

B2B billing SaaS. Turborepo monorepo: apps/web (Next.js App Router),
apps/api (Hono), apps/workers (Inngest), packages/auth, packages/billing,
packages/db (Drizzle + Postgres).

## Auth
- packages/auth/src/session.ts — getSession(), requireOrg()
- apps/web/middleware.ts — org slug extracted from subdomain
- Staff impersonation: requireStaff() in packages/auth/src/staff.ts
- API keys: packages/auth/src/api-key.ts, hashed at rest, prefix nk_

## Money and tenancy
- Stripe webhooks: apps/api/src/routes/stripe.ts (signature check required)
- Every query takes orgId from the session, never from the request body
- Object storage: packages/uploads, signed URLs only, no public buckets

## Do not page on these
- apps/web/app/(marketing)/** — public by design
- packages/db/src/seed/** — local fixtures only
- CSRF on same-origin Server Actions that already check the session

## Threats, ranked
1. Cross-tenant read/write on billing or customer PII
2. AuthZ holes around impersonation and API keys
3. Stripe webhook forgery or replay
4. Stored XSS in org-controlled HTML (invoice memos, support replies)Code language: Markdown (markdown)
```

If a later finding turns out to be a false positive because "we always go through `requireOrg()`," add that sentence to this file and re-run `revalidate`. The second pass will suppress it. Do not dump architecture diagrams here — the agent reads the code itself. You are giving it the map, not the territory.

## Step 5 - Run the cheap scan first

Still in `.deepsec/`:

```
pnpm deepsec scan
pnpm deepsec statusCode language: Bash (bash)
```

`scan` is a local regex pass. No model calls. A few thousand files takes seconds. It writes one JSON `FileRecord` per file under `data/northline/files/`.

`--project-id` is optional while the config has a single project. Once you register more than one project in `deepsec.config.ts`, you need to pass it.

Before you open 8 containers, prove your credentials work. In cloud mode:

```
pnpm deepsec process --project-id northline --agent codex --model brick-complexity-pro:balanced --limit 5Code language: Bash (bash)
```

In local mode:

```
pnpm deepsec process --project-id northline --agent codex --model brick --limit 5Code language: Bash (bash)
```

Five files should cost a few cents and fail fast if the Brick container or Regolo key is misconfigured.

Then calibrate spend on a real slice of the attack surface:

```
# Cloud mode
pnpm deepsec process \
  --project-id northline \
  --agent codex \
  --model brick-complexity-pro:balanced \
  --filter packages/auth \
  --limit 50Code language: Bash (bash)
```

Check cost per file. Multiply by the pending count from `status`. That is your `process` budget. With Brick, the per-file cost will be lower on simple files and higher on complex ones — the variance is the point. If you want to see what Brick picked for each file, check the agent output in `data/northline/files/` — each `FileRecord` logs the model that handled it.

## Parallelise process across local Docker containers

On a laptop, `process` runs batches of 5 files sequentially. A repo with 2,000 candidate files at 3 minutes per batch takes roughly 20 hours. Instead of Vercel Sandbox, you fan out across local Docker containers — each one an isolated deepsec instance pointed at a slice of the repo.

First, build a Docker image with deepsec pre-installed:

```
# Dockerfile.deepsec
FROM node:22-slim
WORKDIR /workspace
RUN npm install -g deepsec
ENTRYPOINT ["deepsec"]Code language: Bash (bash)
```

```
docker build -f Dockerfile.deepsec -t deepsec-runner .Code language: Bash (bash)
```

Now launch one container per package or directory you want to scan. Each container mounts the `.deepsec/` workspace and the repo as read-only, and talks to either the local Brick router or the Regolo API directly.

**Cloud mode** — point containers at Regolo's hosted endpoint:

```
for pkg in packages/auth packages/billing packages/uploads apps/api apps/web apps/workers; do
  container_name="deepsec-$(echo $pkg | tr '/' '-')"
  docker run -d \
    --name "$container_name" \
    -v "$(pwd)/.deepsec:/workspace/.deepsec" \
    -v "$(pwd)/../:/workspace/repo:ro" \
    -e OPENAI_BASE_URL=https://api.regolo.ai/v1 \
    -e OPENAI_API_KEY=sk-your-regolo-key \
    -w /workspace/.deepsec \
    deepsec-runner \
    process --project-id northline --agent codex --model brick-complexity-pro:balanced --filter "$pkg"
doneCode language: Bash (bash)
```

**Local mode** — point containers at the self-hosted Brick router:

```
for pkg in packages/auth packages/billing packages/uploads apps/api apps/web apps/workers; do
  container_name="deepsec-$(echo $pkg | tr '/' '-')"
  docker run -d \
    --name "$container_name" \
    -v "$(pwd)/.deepsec:/workspace/.deepsec" \
    -v "$(pwd)/../:/workspace/repo:ro" \
    -e OPENAI_BASE_URL=http://host.docker.internal:18000/v1 \
    -e OPENAI_API_KEY=sk-your-regolo-key \
    -w /workspace/.deepsec \
    deepsec-runner \
    process --project-id northline --agent codex --model brick --filter "$pkg"
doneCode language: Bash (bash)
```

On Linux, replace `host.docker.internal` with your Docker bridge IP (usually `172.17.0.1`). On macOS and Windows, `host.docker.internal` works out of the box.

What happens under the hood:

1. Each container gets its own isolated `CODEX_HOME` — no session DB collisions between parallel runs.
2. The `--filter` flag restricts each container to files in one package or directory.
3. Brick — whether self-hosted or hosted on Regolo — receives all requests and routes each one independently. Two containers sending requests simultaneously is fine. Brick handles concurrency.
4. Each container writes its findings to the shared `.deepsec/data/northline/` mount. File records are keyed by path, so there are no merge conflicts.
5. deepsec tracks state per-file. If a container crashes or you stop it, re-running the same command only processes pending files.

Monitor all containers at once:

```
docker ps --filter "name=deepsec-" --format "table {{.Names}}\t{{.Status}}"Code language: Bash (bash)
```

Tail logs from a specific container:

```
docker logs -f deepsec-packages-authCode language: Bash (bash)
```

When all containers are done, stop and remove them:

```
docker stop $(docker ps -q --filter "name=deepsec-")
docker rm $(docker ps -aq --filter "name=deepsec-")Code language: Bash (bash)
```

The wall time is now bounded by the largest package, not the total file count. If `packages/auth` has 300 candidates and `apps/api` has 120, the audit finishes when `packages/auth` finishes — not when all 420 are done sequentially.

## Export and act

```
pnpm deepsec export --format md-dir --out ./findings
pnpm deepsec export --format json --out findings.json
pnpm deepsec metrics
```

`md-dir` writes `findings/{CRITICAL,HIGH,MEDIUM,…}/` — one markdown file per finding with the file path, severity, agent reasoning, and suggested fix. Give CRITICAL and HIGH to the team that owns the code, with the `INFO.md` primitive it violated. Ignore MEDIUM until the top band is closed.

`enrich` adds committer data if you want owners on the ticket without leaving the terminal. `process --diff` is a different mode entirely: it reviews only the changed files in a PR or commit range, not the full repo. Useful for CI, but not what this audit is for.

After you patch a finding:

```
# Cloud
pnpm deepsec revalidate --agent claude --model brick-complexity-pro:max --min-severity HIGH

# Local
pnpm deepsec revalidate --agent claude --model brick --min-severity HIGHCode language: Bash (bash)
```

Fixed findings flip to "Fixed" if the agent can see the mitigation in the current code. Then `scan` and `process` again — the second run only picks up **new** candidate files, so it is cheaper than the first.

---

## FAQ

### **What is the difference between local mode and cloud mode?**

Local mode runs Brick in a Docker container on your machine. You configure the model pool — open-source models, Claude, OpenAI, or any mix. The routing decision stays local. Cloud mode points deepsec at Regolo's hosted Brick Complexity Pro endpoint, which routes to Claude and GLM-5.2 from Regolo's pre-configured pool. Local mode is for air-gapped environments and custom pools. Cloud mode is for quick starts and published pricing.

### **How much does a first deepsec audit cost with Brick Complexity Pro?**

Expect $10–30 per 100 candidate files with `brick-complexity-pro:balanced` through Regolo.ai, down from $25–60 without routing. A 2,000-file monorepo runs $200–600 for `process` (balanced mode, routes 60% to GLM-5.2 at $2.31 per 1M and 40% to Claude) plus $50–100 for `revalidate` (max mode, routes to Claude, scoped to HIGH+). The published pricing lets you set a real `--max-cost-usd` cap.

### **Can I use my Claude Pro subscription instead of Regolo?**

Not for a parallelised run. Pro subscriptions hit 5-hour and weekly rate limits well before a monorepo finishes, and Docker containers cannot reuse a local CLI login. You need API access through [Regolo](https://regolo.ai/models/) or another OpenAI-compatible provider.

### **What is GLM-5.2 and why does Brick route easy files to it?**

GLM-5.2 is a 744B-parameter model from Z.ai with 40B active per token, released under MIT license in June 2026. On Regolo it costs $2.31 per 1M input and $6.00 per 1M output, with a 96K context window. Brick routes easy and medium prompts to it because it is cheaper than Claude and handles straightforward code analysis well. Hard prompts — complex multi-tenant auth, webhook forgery chains — go to Claude.

### **Does deepsec send my source code to a third party?**

The model calls go to Regolo.ai's EU-hosted endpoint (cloud mode) or to whichever providers you configured in the Brick pool (local mode). If you self-host Brick in Docker, the routing decision stays local — only the underlying model call leaves your network. The repo itself is never uploaded. Each container reads files from a local mount. On the `codex` backend with `workspace-write` mode, the agent has no network access beyond the model endpoint.

### **What happens if a Docker container crashes mid-run?**

Re-run the same `docker run` command for that package. deepsec tracks state per-file, so finished investigations are not repeated. Only pending or failed files get picked up. The shared `data/` mount means all containers see the latest state.

### **Which Brick mode should I use for each deepsec phase?**

`balanced` for `process` — mixed complexity, quality follows capability. `max` for `revalidate` — accuracy is the whole point, a false "fixed" label buries a real vulnerability. `eco` for `triage` — sorting by severity does not require deep reasoning. `auto` for a first run when you don't know the file complexity distribution yet.

---

## Ship Private AI. Not Infrastructure.

You have the private AI App architecture, bow give it an inference layer built for production.

**Regolo** gives European teams fast, OpenAI-compatible access to Mistral, Llama, Qwen, DeepSeek, GLM, and more — with zero data retention, EU data residency, and no new SDK to learn.

Change your `base_url`. Keep your LangChain code. Start shipping.

### 🚀 [Start your 30-day free trial →](https://regolo.ai/?utm_source=blog&utm_medium=cta&utm_campaign=private-rag)

Build, test, and deploy with no infrastructure to maintain.
**No credit card. No migration project. No compromise on data control.**

### 💬 [Join the Regolo Discord →](https://discord.gg/bqGrVJHeF)

Meet builders working on private RAG, local LLMs, LangChain, Ollama, and production AI systems. Share your setup, get feedback from the community, and speak directly with the Regolo team.

### 🤝 [Talk to an AI Infrastructure Engineer →](https://regolo.ai/contact?utm_source=blog&utm_medium=cta&utm_campaign=private-rag)

Running a sensitive workload, scaling beyond a proof of concept, or assessing a managed EU inference provider? Get a tailored architecture and commercial proposal for your team.

### 📂 [Clone the GitHub repository →](https://github.com/regolo-ai/tutorials/)

Get the full implementation from this guide: ingestion scripts, ChromaDB setup, hybrid retrieval, the **30-Question RAG Floor**, evaluation examples, and deployment configuration.

> **Private AI should not require a private data center.**
> Regolo gives your team an EU-native path from local experimentation to production-grade inference.

---

### Build with Regolo

- **Discord:** [Join the community →](https://discord.gg/bqGrVJHeF)
- **GitHub:** [Explore open-source workflows →](https://github.com/regolo-ai/tutorials/)
- **X / Twitter:** [Follow @regolo\_ai →](https://x.com/regolo_ai)
- **Reddit:** [Join the community →](https://www.reddit.com/r/regolo_ai/)
- **Documentation:** [Read the API docs →](https://docs.regolo.ai)
- **Contact:** [Talk to the team →](https://regolo.ai/contact)

---

*Built with ❤️ by the Regolo team. Questions? [regolo.ai/contact](https://regolo.ai/contact)* or chat with us on [Discord](https://discord.gg/bqGrVJHeF)