---
title: "Security overview"
description: "How Baz finds exploitable vulnerabilities across pull requests, whole repositories, and production, and how it reports only the ones an attacker can reach."
canonical: "https://baz.ai/docs/security"
---

# Security overview

How Baz finds exploitable vulnerabilities across pull requests, whole repositories, and production, and how it reports only the ones an attacker can reach.

Baz treats security as a set of layers that follow your code through its lifecycle. Every pull request is checked for common security mistakes, exploitable vulnerabilities in the changed code, and risky dependency changes. Whole repositories are scanned for weaknesses that were never part of a recent change. Production errors are traced back to the code that caused them.

Every layer works the same way: an agent has to show how an attacker reaches the problem before Baz reports it. A dangerous function call alone is not a finding.

## Defense in depth

On every pull request, **Basic Security Patterns** catches common mistakes like leaked secrets or SQL built from user input, and **Advanced Security** traces real attack paths and checks new packages in your lockfiles. **Full Repo Security Scan** looks for weak spots across the whole codebase, on demand or on a schedule. The **SRE Agent** follows production errors back to the code that caused them. All of them send their findings and fix pull requests back to your team.

These agents sit in the [Software Factory](/docs/agents): the PR agents under **Build**, the scan and the SRE Agent under **Maintain**.

## Exploitability first

Security reviewers that flag every `exec` call or every missing header produce noise that teams learn to ignore. Baz works the other way around:

- **Only reachable issues.** A finding names the vulnerable lines, how an attacker gets there, and a concrete fix. If Baz can't show the path from untrusted input to the dangerous operation, it doesn't post.
- **Your working controls count.** Parameterized queries are not SQL injection, and a framework protection that is still on is not a gap.
- **Explicit misconfigurations are still flagged.** Removing a standard boundary, such as `Access-Control-Allow-Origin: *` on an authenticated route or disabled TLS verification, is reported because the code itself states the weakness.

### What Baz does not report as a security issue


Baz stays quiet about anything an attacker cannot actually reach. That means no theoretical risks without an exploit path, no extra hardening when your main control already works, no style advice dressed up as security, and no generic "validate input" comments. It also skips test fixtures, internal debug tools, code inside third-party libraries, placeholder secrets like `changeme`, and compliance talk without a concrete violation in code.

Developer comments such as `// intentional` or `// safe because...` do not exempt code from these rules. The agent judges the code, not the comment.

## What a security finding contains

Security findings are posted as inline comments on the pull request, like other Baz findings. Each one carries:

- The file and line range, and a description of the attack vector.
- A severity (high, medium, or low) based on the evidence.
- An OWASP Top 10 2025 category, or OWASP Top 10 for LLM Applications IDs for AI-specific issues. See [Prioritization](/docs/security/prioritization).
- A fixing prompt you can hand to [Fixer](/docs/agents/build/fixer) or copy into your own coding agent.

Your team's [memories](/docs/brain/how-memory-works) apply to security agents too: if your team has explained why a pattern is safe in your codebase, Baz takes that into account the next time.

## Turn on the security layers

<Steps>
  <Step title="Enable Basic Security Patterns" icon="shield-check">
    Go to **Software Factory → Build** and make sure **Basic Security Patterns** is enabled. It is part of the default review set.
  </Step>
  <Step title="Enable Advanced Security" icon="lock">
    Advanced Security needs write access, a [sandbox](/docs/integrations/sandbox), and a payment method. The connect wizard on the Software Factory page walks you through all three. Dependency checks run as part of it.
  </Step>
  <Step title="Schedule full repository scans" icon="scan-search">
    In **Software Factory → Maintain**, open **Full Repo Security Scan**, select repositories, and set a **Scheduled scan** or run one now.
  </Step>
  <Step title="Connect production signals" icon="siren">
    Connect an observability integration (Datadog, Sentry, Coralogix, or Splunk) and turn on the **SRE Agent** to trace production errors to fixes.
  </Step>
</Steps>

## Related

<CardGroup cols={2}>
  <Card title="AI code security" href="/docs/security/ai-code-security" icon="bot">
    OWASP Top 10 for LLM Applications checks on code that calls models.
  </Card>
  <Card title="Supply chain" href="/docs/security/supply-chain" icon="package">
    How Baz checks every added or upgraded package in your lockfiles.
  </Card>
  <Card title="Prioritization" href="/docs/security/prioritization" icon="gauge">
    Severity, ranking, and FIX versus FLAG.
  </Card>
  <Card title="Data protection" href="/docs/security/data-protection" icon="lock">
    How Baz handles your code, credentials, and model traffic.
  </Card>
</CardGroup>
