Skip to main content

Supply-chain security, capability intelligence, and trust system for AI agents

Project description

Bastion AI

Supply-chain security, capability intelligence, and trust system for AI agents.

Bastion AI protects bot-first ecosystems by detecting malicious or risky skills/plugins/tools, tracking capability drift over time, and producing machine-readable security artifacts (Dynamic AIBOM).

Installation

pip install bastion-ai-security

For JavaScript/TypeScript analysis support:

pip install bastion-ai-security[js]

PyPI: https://pypi.org/project/bastion-ai-security/

Quick Start

Initialize a project

cd your-agent-project
bastion init

This creates a .bastion/ directory with project configuration and prepares for scanning.

Scan for risks

bastion scan

Bastion auto-discovers plugins, skills, and tools in your project and analyzes them for:

  • System execution — subprocess, os.system, child_process, etc.
  • Network access — requests, fetch, urllib, etc.
  • Secret/environment access — os.environ, process.env, dotenv, etc.
  • Dynamic code execution — eval, exec, Function constructor, etc.
  • Obfuscation patterns — base64+exec, encoded strings, etc.

Check project status

bastion status

Connect to Bastion Cloud

bastion connect

Enables continuous monitoring, trust scores, and dashboard access at https://bastion-ai-hub.replit.app.

How It Works

Plugin Discovery

Bastion automatically finds plugins by scanning:

  • Known framework directories (skills/, tools/, plugins/, extensions/)
  • Framework-specific patterns (OpenClaw, LangChain, AutoGPT, CrewAI)
  • File naming conventions (*_skill.py, *_tool.js, etc.)

Capability Analysis

Each discovered plugin is analyzed using:

  • Python: AST-based static analysis
  • JavaScript/TypeScript: esprima parsing with regex fallback

Risk Levels

Level Description
Critical System execution, dynamic code, obfuscation detected
High Network access, secret/env access detected
Medium New plugin without dangerous capabilities
Low No risky capabilities detected

Drift Detection

On subsequent scans, Bastion compares against the baseline to detect:

  • New plugins added since last scan
  • Modified plugins with changed capabilities
  • Removed plugins no longer present

Generated Artifacts

All artifacts are written to .bastion/:

File Description
security_state.json Overall security posture
capability_surface.json All plugin capabilities
drift_summary.json Changes since last scan
aibom.json Dynamic AI Bill of Materials
events.log.jsonl Rolling event log
baseline.json Baseline for drift comparison

CI/CD Usage

bastion init
bastion scan --ci

Exit codes:

  • 0 — No high-risk findings
  • 1 — High or Critical findings detected

Language Support

  • Python (.py)
  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)

License

MIT

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

bastion_ai_security-0.1.2.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

bastion_ai_security-0.1.2-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file bastion_ai_security-0.1.2.tar.gz.

File metadata

  • Download URL: bastion_ai_security-0.1.2.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for bastion_ai_security-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d1a5540d32cf4ac039fc1a8c318c420b97687d5b6ee833ce6c40b79b6392156f
MD5 66ac1dcdbaa74268b09c85eaf1270088
BLAKE2b-256 6cf19ede18a62c435d87f17e9b490b00de717c00f02a07699e3e56473213b5cc

See more details on using hashes here.

File details

Details for the file bastion_ai_security-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bastion_ai_security-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa454234199821144934b1ff13ce07bdc8ecc8bf1c6aaca3229a8d9c7fe0c70
MD5 f43ed2995faffb828ecb11246ec78ae3
BLAKE2b-256 77631b006945d6e99f71ca1c0bedce977266db42f4883b52ee09f4224ce92f27

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