Extensive Exposure Guard — AI/agent static scans, runtime gateway, OSS dashboard, and CI/GitHub Action
Project description
EEG - Extensive Exposure Guard
Full fledged AI Security gateway and static analysis tool
AI-first cloud security. EEG catches AI-specific risks in agent code and at runtime — before and after you ship.
| Surface | How |
|---|---|
| Static (SAST) | eeg --headless / eeg scan — catalog profiles over your repo |
| Dynamic (gateway) | eeg --gateway-wrap URL — local EEG runtime in front of an AI app |
| Console | eeg --serve — full OSS web app (Django) |
| CI | GitHub Action + CLI exit codes / SARIF |
| Distribute | Push to main → tests → publish eeg-security to PyPI |
See docs/CLI.md for full CLI reference.
Installation
pip install eeg-security
This installs the full package: CLI (scan / gateway-wrap), rules, and the OSS dashboard (eeg --serve), including Django and console dependencies.
Cloud extras (optional authenticated / cloud-static paths):
pip install eeg-security[aws]
pip install eeg-security[azure]
pip install eeg-security[gcp]
pip install eeg-security[all]
From source:
git clone https://github.com/findthehead/EEG.git
cd EEG
pip install -e ".[dev]"
pip install --upgrade eeg-security
Quick start
# Static catalog scan (CI / local) — default profile: code
eeg --headless .
eeg --headless ./my-agent --profile full --format sarif -o eeg-results.sarif
eeg scan ./my-agent --profile agent --fail-on high
# List profiles from catalog.yaml
eeg profiles
# Dynamic runtime: wrap an OpenAI-compatible / chat endpoint
eeg --gateway-wrap https://myaiapp.example --port 8787
# Point your app or clients at http://127.0.0.1:8787
# Full OSS web UI (included with pip install eeg-security)
eeg --serve --host 127.0.0.1 --port 8000
Equivalent module form (useful in CI):
python -m eeg --headless . --profile code --format sarif -o eeg-results.sarif
python -m eeg scan . --profile code --fail-on high
CLI modes
1. Static — --headless / scan
Runs scan profiles from eeg/rules/catalog.yaml against a directory.
| Flag | Default | Description |
|---|---|---|
target |
. |
Path to scan |
--profile |
code |
code · agent · full · model · dep |
--format |
json |
json or sarif |
--output / -o |
stdout | Write report file |
--fail-on |
high |
none · low · medium · high · critical · any |
--cloud |
— | aws · azure · gcp · any (enables cloud static rules on full) |
--include-model |
off | Add model artifact scan |
--pretty |
off | Pretty-print JSON |
--verbose |
off | Scanner progress |
Profiles (summary):
| Profile | Focus |
|---|---|
code |
Code security, forensics, gateway OSS surface |
agent |
Agent / MCP / memory / gateway surfaces |
full |
Broad static pack (+ cloud static when --cloud set) |
model |
Model artifacts |
dep |
Dependency / CVE-oriented dependency scan |
2. Dynamic — --gateway-wrap
Puts EEG’s runtime gateway in front of an upstream AI HTTP endpoint (OpenAI-style chat completions where possible). Use for local dynamic protection and smoke tests before wiring production gateways.
eeg --gateway-wrap https://api.example.com --host 127.0.0.1 --port 8787
# Health: GET http://127.0.0.1:8787/ → {"status":"ok","mode":"gateway-wrap",...}
Private/loopback upstreams are gated; set EEG_ALLOW_PRIVATE_UPSTREAM=1 for local demos, or pass --no-private-upstream to refuse them.
3. Console — --serve
Runs the full Django OSS dashboard. Included with pip install eeg-security (no extra requirements file needed).
Runtime data (SQLite DB, repos) defaults to ~/.eeg for PyPI installs, or the repo root in a source checkout. Override with EEG_HOME.
Exit codes (CI)
| Code | Meaning |
|---|---|
0 |
Below --fail-on threshold |
1 |
Findings at or above --fail-on |
2 |
Usage / path / execution error |
GitHub Action
The published Action runs the same CLI used locally (python -m eeg scan …). Prefer the composite action under .github/actions/eeg-scan, or the repo root Action after install from PyPI.
Composite action (in-repo / reusable)
name: AI Security Scan
on: [push, pull_request]
jobs:
eeg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install EEG
run: pip install eeg-security
- name: EEG scan
uses: findthehead/EEG/.github/actions/eeg-scan@main
with:
path: .
profile: code
format: sarif
output: eeg-results.sarif
fail-on: high
Root Action inputs (marketplace-style)
| Input | Description | Default |
|---|---|---|
path |
Path to scan | . |
profile |
code · agent · full · model · dep |
code |
format |
json · sarif |
sarif |
output |
Report path | eeg-results.sarif |
fail-on |
Severity gate | high |
version |
Pin eeg-security==… |
latest |
cloud |
Optional --cloud |
— |
Example:
- uses: findthehead/EEG@v1
with:
path: .
profile: code
format: sarif
output: eeg-results.sarif
fail-on: high
Upload SARIF to code scanning with github/codeql-action/upload-sarif when desired.
PyPI release
On push to main (non-docs paths), .github/workflows/publish.yml:
- Runs the test matrix (Python 3.9–3.12)
- Builds the package
- Publishes
eeg-securityto PyPI via trusted publishing (OIDC)
Configure the PyPI project’s trusted publisher for this GitHub repo before the first publish. skip-existing: true avoids failing on already-published versions — bump version in pyproject.toml when you intend a new release.
What it scans (high level)
- Agent & prompt risks — injection, unsafe agency, secrets in prompts/config
- MCP / A2A / gateway surfaces — client configs, tool response leaks, OSS gateway patterns
- Code & forensics packs — vendored rule bundles (practice patterns, prompt guard, etc.)
- Dependencies — AI-stack oriented dependency / CVE paths (
dep/full) - Cloud static — AWS / Azure / GCP AI surface rules when
--cloudis set onfull - Runtime (gateway-wrap / OSS gateway) — policy, blocking, and attribution when traffic is proxied
Architecture & structure
eeg/
├── cli.py / cli_serve.py # CLI: headless, serve, gateway-wrap
├── scans/ # Static scan registry
├── probes/ # Dynamic / HTTP surface probes
├── gateway/ # Runtime proxy & streaming
├── rules/ # catalog.yaml + static/dynamic/bundles
└── runtime/ # Guard / policy packs
Web UI and org features live under apps/, core/, eeg/webdata/ (templates + static), and manage.py (OSS console via --serve).
Testing
pip install -e ".[dev]"
pytest tests/test_cli.py tests/test_scan_fixtures.py tests/test_catalog_loader.py -v
# Manual CLI smoke
python -m eeg profiles
python -m eeg --headless fixtures/vulnerable-agent --profile code --fail-on none
python -m eeg --gateway-wrap --help
Benchmark fixtures: fixtures/vulnerable-agent, fixtures/clean-agent.
Troubleshooting
error: not a directory — pass a real project path to --headless / scan.
Gateway wrap refuses upstream — private/loopback targets need EEG_ALLOW_PRIVATE_UPSTREAM=1, or use a public URL; --no-private-upstream forces refusal.
eeg --serve import/Django errors — upgrade to the latest eeg-security (≥2.5). Console deps ship with the package; set EEG_HOME if the default data dir is not writable.
Action / PyPI version lag — wait for the publish workflow on main, or pip install git+https://github.com/findthehead/EEG.git.
Contributing
Pull requests welcome. For major changes, open an issue first. Keep CLI, Action, and README aligned — the Action must call the same eeg / python -m eeg entry points.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eeg_security-2.5.0.tar.gz.
File metadata
- Download URL: eeg_security-2.5.0.tar.gz
- Upload date:
- Size: 508.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f2961fff4cad84705d392ca381430ce0f01344728c6e821dd16625ad651713
|
|
| MD5 |
0ea47fbc03fa438881ddc3452732cac7
|
|
| BLAKE2b-256 |
c9e6a9605675862cd83cc14296e811ac8a7d09334d5e6cf3f6462b6c150f41d6
|
Provenance
The following attestation bundles were made for eeg_security-2.5.0.tar.gz:
Publisher:
publish.yml on promptagainstthemachine/EEG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eeg_security-2.5.0.tar.gz -
Subject digest:
62f2961fff4cad84705d392ca381430ce0f01344728c6e821dd16625ad651713 - Sigstore transparency entry: 2145295111
- Sigstore integration time:
-
Permalink:
promptagainstthemachine/EEG@b86e82311707fd4c3b447a17af41a9abfe466f50 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/promptagainstthemachine
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b86e82311707fd4c3b447a17af41a9abfe466f50 -
Trigger Event:
push
-
Statement type:
File details
Details for the file eeg_security-2.5.0-py3-none-any.whl.
File metadata
- Download URL: eeg_security-2.5.0-py3-none-any.whl
- Upload date:
- Size: 726.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a1fd239560b57b23d4afe3c0e3087bf53b2429821b0f17e2ee7d745d5ec89c1
|
|
| MD5 |
20018eb171daacdb41273fb9802a935e
|
|
| BLAKE2b-256 |
95fd7f8d337002ea5952ea9535f3f9e4f7bc5785a91049de6ccee5b0b499ed31
|
Provenance
The following attestation bundles were made for eeg_security-2.5.0-py3-none-any.whl:
Publisher:
publish.yml on promptagainstthemachine/EEG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eeg_security-2.5.0-py3-none-any.whl -
Subject digest:
7a1fd239560b57b23d4afe3c0e3087bf53b2429821b0f17e2ee7d745d5ec89c1 - Sigstore transparency entry: 2145295167
- Sigstore integration time:
-
Permalink:
promptagainstthemachine/EEG@b86e82311707fd4c3b447a17af41a9abfe466f50 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/promptagainstthemachine
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b86e82311707fd4c3b447a17af41a9abfe466f50 -
Trigger Event:
push
-
Statement type: