---
title: "Advanced Security"
description: "Investigates each pull request for exploitable vulnerabilities by tracing untrusted input to a dangerous sink, and audits lockfile changes for vulnerable, malicious, and risky packages."
canonical: "https://baz.ai/docs/agents/build/advanced-security"
---

# Advanced Security

Investigates each pull request for exploitable vulnerabilities by tracing untrusted input to a dangerous sink, and audits lockfile changes for vulnerable, malicious, and risky packages.

Advanced Security is a usage-based Build agent for vulnerabilities that pattern matching cannot judge. It reports only concrete, exploitable issues in the changed code: it must trace untrusted input from where it enters to the sink where it does harm, and check for guards along the way. It also audits every added or upgraded package in your lockfiles.

## What it catches

### Code vulnerabilities

It looks for the bugs attackers actually use: one user reading another user's data, request input that ends up inside a SQL query or shell command, weak login or crypto, unsafe defaults, and errors that let a request through when they should block it. Each finding is labeled with its OWASP Top 10 category, such as **Broken Access Control** or **Injection**.

Style issues and theoretical weaknesses with no reachable path are not reported.

### Dependencies

When a pull request changes a lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `poetry.lock`, `Pipfile.lock`, `uv.lock`, `Cargo.lock`, `go.sum`, `mix.lock`), Baz checks each added or upgraded package version.

It flags a version with a known CVE, a package that does not exist on its registry (a likely typosquat, rated Critical), a version published less than 24 hours ago, a publisher account under 30 days old, a recent change of owner, install scripts such as `postinstall`, and a new dependency with an incompatible license such as GPL. These are the signs that a package is vulnerable, fake, or newly taken over.

Disposable publisher emails, missing repository URLs, and versions with no matching source tag do not trigger findings alone, but raise the severity of another finding. Every dependency finding cites the registry page or advisory ID. See [Supply chain security](/docs/security/supply-chain).

## Why you can trust it

Advanced Security reports a vulnerability only after it has followed the untrusted input through your repository and confirmed it reaches the dangerous call with no guard on the way. Trivial changes such as typos are skipped, and anything uncertain gets a full look. Dependency findings always cite the registry page or advisory, and every finding carries its OWASP category and a ready fix. See [Prioritization](/docs/security/prioritization).

## What you see

```markdown title="PR comment"
### Any signed-in user can read another workspace's invoices

`GET /api/invoices/:id` loads the invoice by ID and returns it after
`requireAuth`, but never compares `invoice.workspaceId` to the caller's
workspace. The ID comes straight from the URL, so a user can enumerate IDs and
read other customers' invoices. Other routes in `routes/billing.ts` use
`requireWorkspaceAccess(invoice.workspaceId)`.

[Advanced Security · Severity: High] [OWASP: Broken Access Control]

**Baz can fix this** - reply `apply commit` / `apply pr` to fix without changes, or comment to modify the plan.
```

The Build row shows the **Usage-based** badge and reads "Detects vulnerabilities introduced via code and through dependencies using cyber capable models and adversarial prompting."

## Prerequisites

A payment method or credits. Advanced Security is metered.

## Settings

Advanced Security has the same on/off, severity, **Scope**, and memory controls as other Build agents. You can also list **Skip branches** patterns, one per tag, in the Advanced Security step of the guided setup.

The PR conventions for security fix PRs (**Max open fix PRs**, **PR title prefix**, **PR branch prefix**) are set on [Full Repo Security Scan](/docs/agents/maintain/full-repo-security-scan).

## Related

<CardGroup cols={2}>
  <Card title="Supply chain security" href="/docs/security/supply-chain" icon="network">
    Dependency rules in depth.
  </Card>
  <Card title="Full Repo Security Scan" href="/docs/agents/maintain/full-repo-security-scan" icon="scan-search">
    Scan code that was never part of a PR.
  </Card>
  <Card title="Security overview" href="/docs/security" icon="lock">
    How the security layers fit together.
  </Card>
  <Card title="Fixer" href="/docs/agents/build/fixer" icon="wrench">
    Apply the fix from the comment.
  </Card>
</CardGroup>
