Skip to main content

securityagent-core

Shared DLP engine, security skills, and policy enforcement for AI coding agents. Used by SecurityAgent and AgnosticSecurity.

What's inside

Package What it does
endpoint_agent/ DLP engine — file blocking (60+ path patterns), confidence-scored content scanning (PII, credentials, semantic disclosure detection) with structural validators (Luhn, SSA rules, entropy) and context-aware scoring, data flow taint tracking (tags sensitive data at ingress, detects at egress via hash/n-gram/substring matching), tool call argument scanning (MCP/function call DLP + taint registry), behavioral monitoring (8-signal anomaly scoring), honeypot traps, credential scanning. LLM intent analysis with llama3.1:8b default + fallback chain. Notebook-aware .ipynb extraction. PDF extraction via 3-tier pipeline (PyMuPDF → Tesseract OCR → pypdf fallback) with encrypted PDF detection
skills/ Agent-agnostic MCP skills — secure_read, secure_exec, analyze_prompt, scan_output, check_policy, get_session_policy, audit_log
policy/ Policy engine — per-session least privilege, behavioral chain detection (11 attack patterns), audit trail with agent attribution. Obsidian vault integration via memory_bridge.py for cross-session policy context
obsidianMemory/ Obsidian vault — daily session logs, second-brain knowledge base, used by memory_bridge.py for persistent threat/policy tracking
plugin.py Standalone CLI entry point + validate_exec(), validate_prompt(), validate_output() pure functions

Install

pip install git+https://github.com/kaushikdharamshi/securityagent-core.git

# With optional dependencies
pip install "securityagent-core[cloud] @ git+https://github.com/kaushikdharamshi/securityagent-core.git"
pip install "securityagent-core[llm] @ git+https://github.com/kaushikdharamshi/securityagent-core.git"

Usage

Python SDK

from skills.adapters.python_sdk import SecurityAgentSDK

sdk = SecurityAgentSDK(agent_id="my-agent", agent_type="langchain")

# DLP-gated file read
result = sdk.secure_read("/path/to/file")

# Command validation
result = sdk.secure_exec("ls -la")

# Prompt intent analysis
result = sdk.analyze_prompt("Get me all customer SSNs")

MCP Server

python -m skills.adapters.mcp_server  # after pip install

Any MCP-compatible client (Claude Code, Copilot, custom agents) can connect via stdio JSON-RPC.

CLI

python -m plugin ~/.env                                    # File read gate
python -m plugin --exec "cat ~/.env"                       # Exec validation
python -m plugin --prompt "Get all passwords"              # Prompt analysis
python -m plugin --skill secure_read --params '{"path":"~/.env"}'  # Skills layer
python -m plugin --mcp-server                              # MCP server

Claude Code Integration

See integrations/claude_code/ for PreToolUse hook configuration.

Tests

pip install -e ".[dev]"
pytest

Release files for securityagent-core 4.46.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for securityagent-core 4.46.0
File Size Uploaded
securityagent_core-4.46.0.tar.gz 249.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for securityagent-core 4.46.0
File Interpreter ABI Platform
securityagent_core-4.46.0-py3-none-any.whl Python 3 none any Details

Total release size: 530.1 kB

Release files / securityagent_core-4.46.0.tar.gz

Download URL securityagent_core-4.46.0.tar.gz
Size 249.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c054b7d4eacf992d98b1afaea037ba50f2a59936ef2e7adf7ded559a8315b5ca
BLAKE2b-256 checksum
How to use checksums
0c1c85bfc5a7edaca1facb2dc1fac20bf003952fb00e4cb18bffc09b12b670c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / securityagent_core-4.46.0-py3-none-any.whl

Download URL securityagent_core-4.46.0-py3-none-any.whl
Size 280.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47f01dcab66ebef9b466a2325b7d514d5b062e64c171361d38646fba7592d9ab
BLAKE2b-256 checksum
How to use checksums
08936a752b477334522cfb2f07bb797d668a60501216fef596256d82fa9f7fbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

4.49.0

2 release files

4.48.0

2 release files

4.47.0

2 release files

This release

4.46.0 This release

2 release files

4.45.0

2 release files

4.44.0

2 release files

4.39.0

2 release files

4.38.0

2 release files

4.36.0

2 release files

4.35.0

2 release files

4.34.0

2 release files

4.33.0

2 release files

4.32.0

2 release files

4.31.0

2 release files

4.29.0

2 release files

4.28.0

2 release files

4.27.0

2 release files

4.26.0

2 release files

4.25.0

2 release files

4.24.0

2 release files

4.18.0

2 release files

3.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page