---
title: "Basic Security Patterns"
description: "Flags common security mistakes in each pull request: hardcoded secrets, PII in logs, SQL and command injection, and missing input validation, plus LLM risks when the change touches AI code."
canonical: "https://baz.ai/docs/agents/build/basic-security-patterns"
---

# Basic Security Patterns

Flags common security mistakes in each pull request: hardcoded secrets, PII in logs, SQL and command injection, and missing input validation, plus LLM risks when the change touches AI code.

Basic Security Patterns catches the security mistakes that can be judged from the change and its surrounding code. It is included in every plan and is on by default. When a pull request touches LLM code, it also applies the OWASP Top 10 for LLM Applications.

## What it catches

It looks for the common mistakes that leak secrets or let attackers in: API keys and passwords written into code or logs, personal data such as emails or phone numbers sent to logs, SQL or shell commands built from user input, and untrusted input used without checks. It skips fake secrets in tests, placeholder values, generic request logging, and cases your ORM or framework already makes safe.

### LLM and agent code

When the diff touches LLM SDKs (for example OpenAI, Anthropic, Gemini, Bedrock, LangChain, LlamaIndex), agent configuration, or model manifests, Baz adds guidance for the OWASP Top 10 for LLM Applications. Findings carry an LLM01 to LLM10 badge, for example LLM01 prompt injection. See [AI code security](/docs/security/ai-code-security).

## Why you can trust it

Each concern is re-checked before it posts, so a finding must show that the input can actually reach the risky call. Test fixtures, placeholders, and cases your framework already handles stay quiet. See [Verification protocol](/docs/concepts/verification-protocol).

## What you see

```markdown title="PR comment"
### Customer email written to application logs

`logger.info(f"Invoice sent to {customer.email}")` writes the customer's email
address to the shared log stream on every invoice. Log the customer ID instead.

[Basic Security Patterns · Severity: Medium]
```

The Build row reads "Flags security bad practices like unsanitized inputs, PII exposure and SQL injection."

## Prerequisites

None.

## Settings

On/off switch, minimum severity, **Scope**, and **Reviewer memory**. See [Agent settings](/docs/agents/agent-settings). For exploitability analysis that traces input across files and services, turn on [Advanced Security](/docs/agents/build/advanced-security).

## Related

<CardGroup cols={2}>
  <Card title="Advanced Security" href="/docs/agents/build/advanced-security" icon="shield-check">
    Source-to-sink investigation and dependency risk.
  </Card>
  <Card title="Security overview" href="/docs/security" icon="lock">
    Every security layer across the lifecycle.
  </Card>
  <Card title="AI code security" href="/docs/security/ai-code-security" icon="brain">
    OWASP Top 10 for LLM tagging.
  </Card>
</CardGroup>
