Skip to main content

SIGIL security layer for AI agent tool calls — scans MCP tool arguments for leaked secrets, enforces policies, and writes audit logs

Project description

sigil-protocol

🔐 SIGIL security layer for AI agent tool calls — scans MCP tool arguments for leaked secrets, blocks dangerous operations, and writes audit logs. MIT licensed. Works with LangChain, CrewAI, AutoGen, mcp-agent, and OpenAI Agents SDK.

pip install sigil-protocol

30-second start

from sigil_protocol import scan

result = scan('{"key": "AKIAIOSFODNN7EXAMPLE"}')
if result.blocked:
    print(f"BLOCKED: {result.pattern} ({result.severity})")
# → BLOCKED: aws_access_key_id (Critical)

Framework Adapters

LangChain

pip install 'sigil-protocol[langchain]'

Option A — Give the LLM an explicit scan tool:

from sigil_protocol.langchain import SigilScanTool
from langchain.agents import initialize_agent

agent = initialize_agent(
    tools=[SigilScanTool(), my_db_tool, my_api_tool],
    llm=llm,
    ...
)
# The LLM will call sigil_scan before passing data to any backend tool

Option B — Gate an existing tool transparently:

from sigil_protocol.langchain import sigil_tool
from langchain_core.tools import BaseTool

@sigil_tool
class ExecuteSQLTool(BaseTool):
    name = "execute_sql"
    description = "Runs SQL queries"
    def _run(self, query: str) -> str:
        return db.execute(query)
# → Raises ValueError on Critical findings before _run is ever called

CrewAI

pip install 'sigil-protocol[crewai]'
from sigil_protocol.crewai import sigil_gate, SigilBaseTool
from crewai import Agent

# Explicit scan tool
agent = Agent(tools=[SigilBaseTool(), ...])

# Or gate any existing tool
@sigil_gate
class PaymentTool(BaseTool):
    name: str = "initiate_payment"
    ...

AutoGen

pip install 'sigil-protocol[autogen]'
from sigil_protocol.autogen import sigil_function

@user_proxy.register_for_execution()
@assistant.register_for_llm(description="Execute a shell command")
@sigil_function
def run_shell(cmd: str) -> str:
    return subprocess.check_output(cmd, shell=True).decode()
# → Raises RuntimeError if cmd contains a leaked secret

mcp-agent (lastmile-ai)

pip install 'sigil-protocol[mcp]'
from sigil_protocol.mcp_agent import SigilMiddleware

async with app.run() as agent_app:
    agent = Agent(name="my_agent", servers=["filesystem", "github"])
    async with agent.activate() as active_agent:
        llm = await active_agent.attach_llm(OpenAIAugmentedLLM)
        llm.add_middleware(SigilMiddleware())  # ← scans args AND responses

OpenAI Agents SDK

pip install 'sigil-protocol[openai]'
from agents import Agent, Runner
from sigil_protocol.openai_agents import SigilGuardrail

agent = Agent(
    name="secure_agent",
    instructions="You are a helpful assistant.",
    input_guardrails=[SigilGuardrail()],
)
result = await Runner.run(agent, user_input)
# → GuardrailTripwireTriggered if input contains leaked secrets

Pattern Coverage

Patterns are fetched from registry.sigil-protocol.org (cached 5 min locally). Falls back to built-ins if offline.

Category Examples
Cloud credentials AWS, GCP, Azure, OpenAI, GitHub, npm, Stripe
Cryptographic keys RSA/EC private keys, SSH keys, JWT secrets
PII (EU GDPR) IBAN, phone, email, SSN
Dangerous SQL DROP TABLE, DELETE without WHERE, TRUNCATE
Prompt injection Jailbreak openers, system prompt leaks

Configuration

Env variable Default Description
SIGIL_REGISTRY_URL https://registry.sigil-protocol.org Pattern registry endpoint
SIGIL_BUNDLE_TTL 300 Pattern cache TTL in seconds
SIGIL_OFFLINE false Use built-in patterns only
SIGIL_MIN_SEVERITY High Minimum severity to flag (Warn/High/Critical)

License

MIT — this package. The SIGIL core Rust library is EUPL-1.2.

Links

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

sigil_protocol-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

sigil_protocol-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sigil_protocol-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sigil_protocol-0.1.0.tar.gz
Algorithm Hash digest
SHA256 19f621c381bbfbc0535f712e399cb36992f432730b36cca9c6760572f483a1b7
MD5 41490844d14f8cc8456526655a3e5c86
BLAKE2b-256 dc1f7609d1cf552073405222816eda0eaed97e521b3f8c75e847f7a04f38575d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sigil_protocol-0.1.0.tar.gz:

Publisher: publish.yml on sigil-eu/sigil-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: sigil_protocol-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sigil_protocol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 386b11814e13f43dc1149a8cf4daeb6764d4962e45ae9e9b4616a3f6f9078a0a
MD5 b67e65350a25aa509443a58103f50749
BLAKE2b-256 43c90d76707dcfa5858b538cfeb2f0343be0c9c984b82c8bb39718eff7cf99a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sigil_protocol-0.1.0-py3-none-any.whl:

Publisher: publish.yml on sigil-eu/sigil-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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