Skip to main content

Shadow AI detector — scans network connection logs for unsanctioned AI API/service usage and cross-references against an approved-services allowlist.

Project description

shadow-sniffer

PyPI License: MIT

Shadow AI detector — scans network connection logs for unsanctioned AI service usage and cross-references against an approved-services allowlist.

Educational / authorized-use tool. shadow-sniffer reads a local export of outbound network connections — no live agent, packet capture, or network access required. Use it on your own logs, or on logs you have permission to analyze.

Why shadow-sniffer?

Employees and AI agents routinely send data — source code, customer records, credentials, internal documents — to third-party AI chat apps and APIs that IT and security never approved. This is "Shadow AI": functionally the same risk as Shadow IT, but the exfiltration channel is a chat box or an API call that looks like normal HTTPS traffic.

shadow-sniffer is the fourth tool in the Grassroots Expansion Pack (mcp-sploitprompt-fuzznhi-huntershadow-sniffer). Where the others attack an AI deployment's tools, brain, and identity layer, shadow-sniffer looks at the data layer — where is data actually going.

It ships with a curated catalog of 39 known AI service domains across 8 categories (LLM Chat, LLM API, Code Assistant, Image/Video Generation, Voice & Audio, and more), matches them against a connection log, and flags any hit that isn't on your organization's approved list. Findings are tagged MITRE ATT&CK T1567 (Exfiltration Over Web Service).

Quick start

pip install shadow-sniffer

shadow-sniffer scan --input connections.json --approved approved_services.json

Try it without any setup

git clone https://github.com/Prasanna-27eng/shadow-sniffer
cd shadow-sniffer
pip install -e .

shadow-sniffer scan \
  --input examples/sample_connections.json \
  --approved examples/approved_services.json

Connection log format

A JSON file with a connections list (or a bare list), or a CSV with a header row. Recognized fields (aliases in parentheses):

Field Aliases
timestamp time, ts
src_host source_host, hostname
src_ip source_ip
user username
process_name process, proc_name
dest_host dest_domain, destination_domain, remote_hostname
dest_ip destination_ip, remote_ip
dest_port destination_port, remote_port
bytes_sent bytes_out, tx_bytes

Only dest_host/its aliases are matched against the AI service catalog — shadow-sniffer does not perform DNS or reverse-DNS lookups.

Approved-services allowlist

A JSON file with an approved_domains list, or a plain-text file with one domain per line (# comments allowed). Domains are matched by suffix, so openai.com in your allowlist covers both api.openai.com and chat.openai.com.

Console commands

  • shadow-sniffer scan --input <log> [--approved <allowlist>] [--output results.json] — scan a connection log, print findings as a table, exit non-zero if any unapproved AI service usage is found (usable as a CI gate).
  • shadow-sniffer list-services — print the full built-in AI service catalog.

AegisTrace integration

shadow-sniffer scan --input connections.json \
  --aegistrace-url https://your-aegistrace-instance \
  --aegistrace-key $AEGISTRACE_INGEST_KEY

Each finding is POSTed to /api/ingest/shadowsniffer-event, creating an AgentAction entry visible in AegisTrace's /app/agent-security dashboard.

Testing

pip install -e ".[dev]"
pytest

Companion projects

  • mcp-sploit — dynamic security testing for MCP servers (attacks the tools layer)
  • prompt-fuzz — jailbreak and prompt-injection fuzzer for LLM endpoints (attacks the brain layer)
  • nhi-hunter — AWS IAM privilege-escalation graph builder (attacks the identity layer)

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shadow_sniffer-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shadow_sniffer-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file shadow_sniffer-0.1.0.tar.gz.

File metadata

  • Download URL: shadow_sniffer-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for shadow_sniffer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 243fbb628fb972aa3f8ec47115165c1135ce03c27a07f54d9a19477da564a0d8
MD5 7229ad4a7fee07fc83c65ea81b95a9b7
BLAKE2b-256 27826f20fcd812e1ec54a9981bf850d51459ae353e27a0927e88a026f7f17df8

See more details on using hashes here.

File details

Details for the file shadow_sniffer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shadow_sniffer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for shadow_sniffer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85a77de16c177fff37d775e42e0a2329b2adc1297e612c4d0288c2260bc57258
MD5 ace921b129b9a0add363a4c12b4bec6b
BLAKE2b-256 c1d6dc4d284b2dd27a8447963be445a591eed8f32c5ecb7a4d6e52ce80fef128

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page