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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
securityagent_core-4.38.0.tar.gz
(195.2 kB
view details)
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 securityagent_core-4.38.0.tar.gz.
File metadata
- Download URL: securityagent_core-4.38.0.tar.gz
- Upload date:
- Size: 195.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fdd8ce87e4d432888347b818eb0d5412d27484029a200182fde8cee7d81f8a0
|
|
| MD5 |
6f73db38788122dcb1ab48bba242de25
|
|
| BLAKE2b-256 |
a4b39650ac7379420c4772a6f423823e9f9a2e96338d57a6ca6122dc8c17fc94
|
File details
Details for the file securityagent_core-4.38.0-py3-none-any.whl.
File metadata
- Download URL: securityagent_core-4.38.0-py3-none-any.whl
- Upload date:
- Size: 224.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24dfe09956a93a234a6ac9b7cb63b8c1891f89591838a15f2afac560d1ccd553
|
|
| MD5 |
21f127f8268a37a1ac38bdf22d5b246a
|
|
| BLAKE2b-256 |
c9e422708e124f1e8ea29976539f47ababee07ffc6c36b52774a47f627a18803
|