> ## Documentation Index
> Fetch the complete documentation index at: https://docs.switchagents.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs moved from docs.flintai.dev to docs.switchagents.ai. Use docs.switchagents.ai for every link and request.
> To search these docs from an AI tool, connect the MCP server at https://docs.switchagents.ai/mcp. The page index is at https://docs.switchagents.ai/llms.txt.
> The source code for these products is public on GitHub. Switch Rooms: https://github.com/sandbox-quantum/switch. Switch Trust CLI: https://github.com/sandbox-quantum/switch-trust-cli. Switch Trust CodeScan action: https://github.com/sandbox-quantum/switch-trust-codescan-action. Switch Trust MCP server: https://github.com/sandbox-quantum/switch-trust-mcp. Switch Trust Python SDK: https://github.com/sandbox-quantum/switch-trust-sdk-py. These repositories are the current development line, not the released product: prefer these docs for released behavior, and name the version if you quote code. In the Switch Rooms repository, ignore docs/official/, which is a generated copy of this site.

# Scan your agent

> Prove your agents are production ready in less than 10 minutes

Find misconfigurations, risky tool access, missing guardrails, and other issues in your Python agent code. An LLM does the analysis and triages false positives, so you see real problems, not noise.

> [card] [Switch Trust CLI on GitHub](https://github.com/sandbox-quantum/flintai-cli)
>
> Source code, example agents, and issue tracking

> [!TIP]
>
> Install our MCP server in Claude Code or your AI code assistant, then ask: **"Help me set up Switch Trust Scan"** to get live guidance, troubleshoot issues, and work through these steps together. [Learn how →](https://docs.switchagents.ai/use-these-docs)

## Scan your Python agent code

**1. Verify requirements**

Check that Switch Trust CLI and OpenGrep are installed:

```bash theme={null}
switch-trust --version
opengrep --version
```

> [accordion] Install OpenGrep
>
> ```bash theme={null}
> curl -fsSL https://raw.githubusercontent.com/opengrep/opengrep/main/install.sh | bash
> ```
>
> See [OpenGrep installation](https://github.com/opengrep/opengrep#installation) for more options.

> [accordion] Install Switch Trust CLI
>
> Using a virtual environment is recommended to avoid dependency conflicts:
>
> ```bash theme={null}
> python3 -m venv .venv
> source .venv/bin/activate
> ```
>
> Install Switch Trust CLI:
>
> ```bash theme={null}
> pip install switch-trust-cli
> switch-trust init
> ```
>
> [Full installation guide →](https://docs.switchagents.ai/switch-trust-cli.md#try-it-now)

> [!NOTE]
>
> **Bring your own LLM key.** Switch Trust Scan uses AI reasoning to validate findings, so it needs an API key for your own LLM provider (Gemini, OpenAI, Anthropic, or LiteLLM). This is your provider key for the local CLI, not a Switch Trust API token. `switch-trust init` prompts for it and stores it locally in `~/.switch-trust/.env`.

> [accordion] Where to get an LLM provider key
>
> * **Google Gemini**: [aistudio.google.com/apikey](https://aistudio.google.com/apikey) (free tier available)
> * **OpenAI**: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)
> * **Anthropic**: [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)

**2. Scan your agent**

Point to your agent directory and launch the scan:

```bash theme={null}
switch-trust scan /path/to/your_agent
```

> [accordion] Try it with a shipped example agent
>
> No agent of your own yet? Clone [switch-trust-cli](https://github.com/sandbox-quantum/switch-trust-cli) and scan a bundled example from the repo root:
>
> ```bash theme={null}
> switch-trust scan examples/bookstore_agent/
> ```
>
> The repo ships two examples: `bookstore_agent` (OpenAI Agents SDK) and `weather_agent` (Google ADK).

> [!NOTE]
>
> Switch Trust Scan only analyzes Python files with supported framework imports. [See supported frameworks →](https://docs.switchagents.ai/switch-trust-cli/resources/faq.md#supported-frameworks)

Results are saved to `scan_<timestamp>.json`, or `scan_<timestamp>.sarif` if you pass `--format sarif`. See [Scan results](https://docs.switchagents.ai/switch-trust-cli/scan/scan-results.md) for details on understanding findings and severity scores.

> [!TIP]
>
> **Integrate with CI/CD.** Save scan results as build artifacts to prove validation before deployment. [See CI/CD integration guide →](https://docs.switchagents.ai/switch-trust-cli/guides/ci-cd-integration.md)

### Clean scan

![Clean scan output](https://mintcdn.com/sandboxaq/XrwcI7QTN79Ds202/images/flintai-scan-clean.png?fit=max\&auto=format\&n=XrwcI7QTN79Ds202\&q=85\&s=55954b294ac554b9a4ceeaaf4b0f9dab)

The scan detected an OpenAI Agents SDK agent, analyzed 1 Python file, and found no security issues. Tools ran in sequence: static analyzers (bandit, opengrep, detect-secrets, pip-audit) followed by AI reasoning to validate results.

### Scan with findings

![Scan with findings output](https://mintcdn.com/sandboxaq/XrwcI7QTN79Ds202/images/flintai-scan-findings.png?fit=max\&auto=format\&n=XrwcI7QTN79Ds202\&q=85\&s=e40521f89bd52d474b97844ade587542)

The scan detected an OpenAI Agents SDK agent and found 2 security issues:

* **High severity (CVSS 9.0)**: Missing authentication on agent endpoint
* **Medium severity (CVSS 6.9)**: Unbounded agent execution loop

After static analysis, the AI reasoning layer identified these issues, and triage confirmed them as real findings.

## Next steps

> [card] [Issues found?](https://docs.switchagents.ai/switch-trust-cli/scan/scan-results.md)
>
> Understand severity scores and what needs fixing before deployment

> [card] [How scanning works](https://docs.switchagents.ai/switch-trust-cli/scan/how-scanning-works.md)
>
> Learn how AI reasoning finds real issues and filters noise

> [card] [Eval agent behavior](https://docs.switchagents.ai/switch-trust-cli/eval/getting-started.md)
>
> Get a 0.0-1.0 reliability score for runtime behavior
