Open-source security scanning for AI agents, MCP integrations, model artifacts, and runtime gateways.
Quick start • GitHub Action • Coverage • Architecture • Contributing • CLI reference
EEG gives small and growing security teams one Python-based tool for checking AI projects before release and monitoring AI traffic during operation. It can:
- find insecure agent, prompt, MCP, gateway, dependency, and model-artifact patterns;
- emit JSON or SARIF for CI and GitHub Code Scanning;
- apply an optional runtime protection layer in front of an AI HTTP endpoint; and
- run a local dashboard for investigating projects and findings.
No hosted account is required for the open-source scanner.
If EEG is useful in your workflow, star the repository and watch Releases to receive stable Action and PyPI updates.
Install from PyPI:
pip install eeg-securityRun a reproducible scan:
eeg scan . --profile codeWrite a CI-ready SARIF report:
eeg scan . \
--profile agent \
--format sarif \
--output eeg-results.sarif \
--fail-on highThe examples in fixtures/ make it easy to verify the behavior:
eeg scan fixtures/vulnerable-agent --profile code --fail-on none
eeg scan fixtures/clean-agent --profile code --fail-on anyAdd EEG to a workflow and upload the report to GitHub Code Scanning:
name: EEG AI Security Scan
on:
push:
pull_request:
permissions:
contents: read
security-events: write
jobs:
eeg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan AI security risks
uses: Breakintelligence/EEG@v2
with:
path: .
profile: agent
format: sarif
output: eeg-results.sarif
fail-on: high
- name: Upload SARIF
if: ${{ always() && hashFiles('eeg-results.sarif') != '' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: eeg-results.sarifv2 is the floating major-version ref for the released Action. For a fully
immutable workflow, pin the exact release tag or commit SHA. See
RELEASING.md for the release process.
| Input | Description | Default |
|---|---|---|
path |
Repository path to scan | . |
profile |
code, agent, full, model, or dep |
code |
format |
json or sarif |
sarif |
output |
Report path | eeg-results.sarif |
fail-on |
none, low, medium, high, critical, or any |
high |
version |
Exact eeg-security version from PyPI; empty uses latest |
latest |
cloud |
aws, azure, gcp, or any for the full profile |
empty |
extra-args |
Additional CLI arguments | empty |
| Surface | Examples |
|---|---|
| Agent and prompt security | Unsafe agency, prompt risks, secret handling, agent configuration |
| MCP and A2A | Client configuration, tool-response leakage, protocol surfaces |
| Gateway security | Open-source gateway patterns and runtime policy checks |
| Code security | Secret, configuration, serialization, and repository-level checks |
| Dependencies | AI-focused dependency and CVE lookup paths |
| Cloud AI configuration | AWS Bedrock, Azure OpenAI, and Google Vertex AI checks |
| Model artifacts | Scans of supported model-related files |
| Runtime protection | Optional prompt, jailbreak, toxicity, PII, and tool-abuse models |
Choose a scan profile based on the question you are trying to answer:
| Profile | Focus |
|---|---|
code |
Code, secrets, gateway, and forensic checks |
agent |
Agent, MCP, memory, and gateway surfaces |
full |
Broad static coverage; adds cloud checks when --cloud is supplied |
model |
Model artifacts |
dep |
AI dependency and vulnerability checks |
List the current rule profiles:
eeg profilesPlace EEG in front of a compatible AI HTTP endpoint:
eeg --gateway-wrap https://api.example.com --host 127.0.0.1 --port 8787
curl http://127.0.0.1:8787/Point local clients at http://127.0.0.1:8787. Private and loopback upstreams are
blocked by default. Set EEG_ALLOW_PRIVATE_UPSTREAM=1 only for a controlled
local demonstration, or use --no-private-upstream to make refusal explicit.
The optional ML runtime guard requires the packages in
requirements-runtime-ml.txt. Disable it with
EEG_RUNTIME_ML=0. See Runtime ML for model and policy
configuration.
The Traces view shows each gateway decision alongside the provider, latency, model route, and risk signal. This makes it clear which requests were blocked, which were accepted, and which AI endpoint handled them.
The PyPI package includes the open-source dashboard:
eeg --serve --host 127.0.0.1 --port 8000Runtime data is stored under ~/.eeg for installed packages and under the
repository root for source checkouts. Override that location with EEG_HOME.
The dashboard exposes practical controls for real-time monitoring, model scanning, telemetry, and policy enforcement. Teams can save the settings they want the scanner and runtime gateway to apply.
pip install eeg-security # scanner, gateway, and dashboard
pip install "eeg-security[aws]" # AWS-specific checks
pip install "eeg-security[azure]" # Azure-specific checks
pip install "eeg-security[gcp]" # Google Cloud-specific checks
pip install "eeg-security[all]" # all cloud extrasFrom source:
git clone https://github.com/Breakintelligence/EEG.git
cd EEG
python -m pip install -e ".[dev]"Python 3.10 or newer is required. See the CLI reference for every command and flag.
The scanner packages are under eeg/scans/,
gateway and runtime controls under eeg/gateway/ and
eeg/runtime/, and rule definitions under
eeg/rules/. The Django dashboard lives in
apps/ and core/.
| Code | Meaning |
|---|---|
0 |
No finding met the configured --fail-on threshold |
1 |
At least one finding met the threshold |
2 |
Usage, path, or execution error |
EEG findings should be reviewed in the context of the application. Pattern and dependency checks can produce false positives or miss newly introduced techniques. Cloud scans depend on the enabled credentials, permissions, and provider APIs. Runtime mediation only covers traffic routed through EEG, and source scanning does not prove the absence of vulnerabilities.
For private vulnerability reports, follow SECURITY.md.
python -m pip install -e ".[dev]"
python -m pytest \
tests/test_cli.py \
tests/test_sarif.py \
tests/test_scan_fixtures.py \
tests/test_catalog_loader.pyCI also scans the vulnerable benchmark fixture and preserves the generated SARIF as a workflow artifact.
Bug reports, false-positive examples, rules, fixtures, documentation, and integration ideas are welcome. Start with CONTRIBUTING.md, then use an issue template or open a pull request.
Please follow the Code of Conduct.
- Not a directory: pass a real project path to
scanor--headless. - Gateway refuses a local upstream: local access is intentionally gated; use the explicit demo environment variable only in a controlled environment.
- Django startup errors: upgrade
eeg-security, then check thatEEG_HOMEpoints to a writable directory. - A SARIF report is missing: make sure the EEG step completed far enough to
write
output; scanner findings can make the step exit non-zero by design.
EEG is available under the Apache License 2.0.


