AI News HubLIVE
站内改写3 min read

Batta – Plan-Phase Security Reviews for AI Coding Agents (OSS)

Batta is an open-source tool that provides security reviews before AI coding agents write code, catching design flaws when they are cheapest to fix by integrating security context during the planning phase.

SourceHacker News AIAuthor: dolevco1

Notifications You must be signed in to change notification settings

Fork 0

Star 1

BranchesTags

Open more actions menu

Folders and files

NameName

Last commit message

Last commit date

Latest commit

History

2 Commits

2 Commits

.github

.github

.vscode

.vscode

deploy

deploy

docs

docs

packages

packages

scripts

scripts

.dockerignore

.dockerignore

.env.example

.env.example

.gitignore

.gitignore

.mcp.json

.mcp.json

.prettierrc

.prettierrc

CHANGELOG.md

CHANGELOG.md

CLAUDE.md

CLAUDE.md

CODE_OF_CONDUCT.md

CODE_OF_CONDUCT.md

CONTRIBUTING.md

CONTRIBUTING.md

GOVERNANCE.md

GOVERNANCE.md

LICENSE

LICENSE

README.md

README.md

docker-compose-https.yml

docker-compose-https.yml

docker-compose.yml

docker-compose.yml

eslint.config.js

eslint.config.js

package.json

package.json

pnpm-lock.yaml

pnpm-lock.yaml

pnpm-workspace.yaml

pnpm-workspace.yaml

tsconfig.json

tsconfig.json

Repository files navigation

Secure agent work, by design.

Batta gives agents the right security and compliance context — so every decision is informed before code is written. It is the security architect running at machine speed: grounded in your actual code, cloud config, and org policies, not generic checklists.

The core value is not another chat prompt. It is the indexed security model of your system: services, entry points, identities, cloud resources, data flows, trust boundaries, data classifications, threats, mitigations, and known gaps. When an agent starts new work, Batta compares the proposed change against that model and returns concrete questions, risks, required tasks, and evidence-backed attestations for human review.

Why Batta

Plan-phase reviews run security review before code is written — catching design flaws when they are cheapest to fix, not during PR or after deploy.

Full context, always grounds every review in your actual code, cloud config, and org policies — not generic checklists. Every review reflects what your system really does.

System of record for humans logs every decision, finding, and attestation. Humans stay in control of what matters — with a complete audit trail when it counts.

Agent-native workflow exposes indexing and reviews over MCP so Claude Code, Cursor, Codex, Copilot Agent, and other coding agents can use Batta from inside the repo.

Local-first OSS setup works without an LLM key for MCP indexing and review loops.

Quick Start

Start Batta:

cp packages/api/.env.example packages/api/.env docker compose up

Open http://localhost:3100/onboarding, choose a stable repo key such as payments-service, then paste this prompt into your coding agent while the target repository is open:

Fetch Batta onboarding instructions from: http://localhost:3101/api/onboarding/agent-led?repo=

Then follow those instructions in this repository. Configure MCP, verify the connection, and index this repository before considering onboarding complete so future reviews have architecture context.

That is the recommended onboarding path. The agent fetches current setup instructions from your local Batta server, configures MCP for the repository, verifies the connection, indexes the repo, and adds standing instructions to run Batta reviews before future feature work. Indexing is the step that makes reviews architecture-aware instead of generic.

Manual setup and production OAuth details live in docs/agent-integration.

How It Works

coding agent | | MCP v batta API ----> Postgres + pgvector ----> indexed architecture context | v security review loop

The coding agent indexes the repository through Batta MCP.

Batta stores structured architecture context: services, features, DFDs, threat models, relationships, and review gaps.

Before a feature or meaningful code change, the agent starts a security review.

Batta compares the change to the indexed architecture and returns missing context, risks, and required security tasks.

The agent implements the change and submits evidence-backed attestations for review.

Local Development

pnpm install cp packages/api/.env.example packages/api/.env docker compose up -d postgres redis pnpm --filter @batta/api dev pnpm --filter @batta/ui dev

The API runs on http://localhost:3101 and the UI runs on http://localhost:3100. Check local readiness with:

pnpm doctor

The default local .env disables auth and embeddings so the first run does not require OAuth, certificates, or model keys.

Local Ollama Models

Batta can use Ollama for local chat, indexing agents, work-item review agents, and semantic embeddings. Example setup:

ollama pull qwen2.5-coder:14b ollama pull qwen2.5-coder:7b ollama pull nomic-embed-text

LLM_PROVIDER=ollama OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_CHAT_MODEL=qwen2.5-coder:14b OLLAMA_SMALL_CHAT_MODEL=qwen2.5-coder:7b

EMBEDDINGS_ENABLED=true EMBEDDINGS_PROVIDER=ollama OLLAMA_EMBEDDING_MODEL=nomic-embed-text OLLAMA_EMBEDDING_DIMENSION=768

Local model quality varies; larger coder models tend to be more reliable for the text-formatted tool calls Batta agents use. Embeddings from different providers or models should not be mixed in the same persisted vector data unless the indexes are rebuilt.

Architecture

┌─────────────┐ Browser ─────▶│ UI │ (React + Vite) └──────┬──────┘ │ REST + SSE ┌──────▼──────┐ Coding agent ─▶│ API │ (Express + MCP) (MCP/OAuth) └──┬───────┬──┘ │ │ ▼ ▼ Postgres Redis + pgvector (cache / pubsub)

Package Purpose

@batta/ui React frontend for onboarding, reviews, knowledge base, chat, and integrations.

@batta/api Express REST API and MCP endpoint.

@batta/core LLM task runtime, tools, and memory primitives.

@batta/shared Persistence, services, integrations, and shared types.

@batta/data-indexer Background scanner for code and cloud indexing.

Documentation

Docs index

Agent onboarding

Manual MCP configuration

Security review loop design

Contributing

Security policy

License

Apache-2.0 — see LICENSE.

About

Security by design for AI agents

Resources

Readme

License

Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks

Report repository

Releases

No releases published

Packages 0

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

TypeScript 99.6%

Other 0.4%