GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - RitualDev-Lab/agentshield-python: Native Python SDK for AgentShield: Zero-leak secret defense, environment isolation, and kernel sandbox for LangGraph, CrewAI, AutoGen, and Smolagents.

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src/agentshield
src/agentshield
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements-build.txt
requirements-build.txt
 
 

Repository files navigation

AgentShield Python SDK 🛡️

PyPI version Python 3.10+ License: MIT Interactive Playground Trust Center

Enterprise-grade Zero-Leak Secret Defense & Sandbox for Autonomous AI Agents built with LangGraph, CrewAI, AutoGen, LlamaIndex, and Smolagents.

Documentation • Web Portal • Trust Center • Issues


⚡ Key Features

  • @shield.protect Decorator: Zero-boilerplate function and tool protection. Automatically intercepts arguments and return values.
  • Framework Integrations:
    • LangChain & LangGraph: AgentShieldCallbackHandler
    • CrewAI: AgentShieldCrewHook
    • LlamaIndex: AgentShieldLlamaHandler
    • Microsoft AutoGen: AgentShieldAutoGenGuard
  • Zero-Leak Redaction: 40+ credential types (OpenAI, Anthropic, AWS, GitHub, Stripe, Slack, private keys, /proc/self/environ).
  • Environment Sanitization: sanitize_env() replaces sensitive variables with virtual mock tokens.
  • HMAC-SHA256 Audit Ledger: Cryptographically seals every inspection with microsecond overhead.

📦 Installation

pip install agentshield-defense

Note: In code, import as standard import agentshield or from agentshield import shield.


🚀 Usage Guide

1. The @shield.protect Decorator

Decorate any agent tool, custom function, or LLM wrapper:

from agentshield import shield

@shield.protect
def deploy_infrastructure(target: str, config: str) -> str:
    # Any incoming AWS keys or OpenAI keys in config are automatically masked
    return f"Deployed {target} with token: AKIAIOSFODNN7EXAMPLE"

# When executed:
output = deploy_infrastructure("prod-cluster", "key=sk-1234567890abcdef1234567890abcdef")
print(output)
# -> "Deployed prod-cluster with token: [AGENTSHIELD_REDACTED:AWS_ACCESS_KEY:a1b2c3d4e5f6]"

For strict enforcement (raising PermissionError on leak):

from agentshield import protect

@protect(strict=True)
def sensitive_operation():
    ...

2. LangGraph & LangChain Integration

from langchain_openai import ChatOpenAI
from agentshield import AgentShieldCallbackHandler

shield_handler = AgentShieldCallbackHandler()

llm = ChatOpenAI(
    model="gpt-4o",
    callbacks=[shield_handler]
)
# Outgoing prompts and tool invocations are inspected and sanitized in real time

3. CrewAI Guardrail Hook

from crewai import Task
from agentshield import AgentShieldCrewHook

hook = AgentShieldCrewHook()

task = Task(
    description="Analyze server environment and deploy database",
    expected_output="Deployment summary"
)

hook.before_task_execution(task)

4. LlamaIndex Callback Handler

from llama_index.core import Settings
from agentshield import AgentShieldLlamaHandler

Settings.callback_manager.add_handler(AgentShieldLlamaHandler())

5. Microsoft AutoGen Message Guard

from agentshield import AgentShieldAutoGenGuard

guard = AgentShieldAutoGenGuard()
clean_message = guard.filter_message(incoming_message)

🔒 Security & Compliance

  • Zero Cloud Exfiltration: Runs 100% locally with AGENTSHIELD_AIR_GAPPED=1.
  • Pre-filled SIG Lite / CAIQ: Download the Vendor Risk Assessment Packet at ritualdev.in/trust.
  • Statutory Alignment: Designed for India DPDP Act 2023, EU GDPR, and SOC 2 Type II.

📄 License

MIT © RitualDev Studio

About

Native Python SDK for AgentShield: Zero-leak secret defense, environment isolation, and kernel sandbox for LangGraph, CrewAI, AutoGen, and Smolagents.

Resources

Readme
MIT license

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.