Skip to main content

Bidda Compliance Intelligence SDK + `bidda` CLI — full MCP parity, api_key + Skyfire + USDC auth, LangChain/AutoGen/CrewAI wrappers

Project description

bidda-shield

smithery badge CISA Secure by Design

Verified compliance intelligence for AI agents. Stop your LangChain, AutoGen, and CrewAI agents from hallucinating legal requirements.

pip install bidda-shield

The problem

AI agents making decisions about hiring, credit scoring, data processing, or content moderation are operating under dozens of overlapping regulations — GDPR, EU AI Act, HIPAA, CCPA, Basel III. When an agent gets the legal logic wrong, it isn't just a bug. It's a regulatory liability event.

LLMs hallucinate regulations. bidda-shield doesn't.

Every compliance node in the Bidda registry traces to a specific clause of a primary legal instrument, verified against the source URL, and drift-checked weekly. No inference. No approximation.


Pick your path

You are... Use How to auth
A developer wanting the simplest start API key (Starter / Pro / Enterprise / evaluation) BiddaShield(api_key="...")
Building an autonomous agent with a wallet Skyfire JWT BiddaShield(skyfire_token="...")
Headless, no account, on-chain only Direct Base USDC BiddaShield(base_tx_hash="0x...")
Just browsing No auth (discovery tier is free) BiddaShield()

Get an API key at bidda.com/pricing — Starter is $49/mo with 100 unlocks. No key? Discovery is free forever.


5-minute quickstart

pip install bidda-shield
from bidda_shield import BiddaShield

shield = BiddaShield(api_key="your-bidda-api-key")

# 1. Search the registry (free, no quota hit)
hits = shield.search_nodes("biometric data EU")
print(hits[0]["title"])     # EU AI Act Article 5 — Prohibited AI Practices
print(hits[0]["bluf"])      # Plain-English summary

# 2. Pre-flight compliance check (free, the headline tool)
verdict = shield.check_action_compliance(
    "process EU resident biometric data for access control",
    jurisdiction="eu",
)
print(verdict["risk_level"])   # "HIGH"
print(verdict["match_count"])  # 10

# 3. Unlock the full machine-executable workflow for the top match ($0.01)
top = verdict["matches"][0]
node = shield.get_node(top["node_id"], vault=True)
for step in node["deterministic_workflow"]:
    print(step["step"], step["action"])

That's it. The pattern: search → check → unlock. Free everywhere except the final unlock.


LangChain

from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from bidda_shield import BiddaLangChainTool

llm  = ChatOpenAI(model="gpt-4o")
tool = BiddaLangChainTool()

agent = initialize_agent(
    tools=[tool],
    llm=llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True,
)

agent.run(
    "My agent is about to make an automated credit decision. "
    "What regulations apply and what do they require?"
)

The tool returns the regulation title, domain, plain-English summary (BLUF), and a link to the full verified node — for $0.01 USDC per full unlock.


AutoGen

import autogen
from bidda_shield import BiddaAutoGenTool

config_list = [{"model": "gpt-4o", "api_key": "YOUR_OPENAI_KEY"}]

bidda_tool = BiddaAutoGenTool()

assistant = autogen.AssistantAgent(
    name="compliance_assistant",
    llm_config={
        "config_list": config_list,
        "functions": [bidda_tool.function_schema],
    },
)

user_proxy = autogen.UserProxyAgent(
    name="user",
    human_input_mode="NEVER",
    function_map={"bidda_compliance_lookup": bidda_tool.execute},
)

user_proxy.initiate_chat(
    assistant,
    message="What does GDPR Article 22 require for automated decision-making?",
)

CrewAI

from crewai import Agent, Task, Crew
from bidda_shield import BiddaCrewAITool

compliance_tool = BiddaCrewAITool()

compliance_officer = Agent(
    role="Chief Compliance Officer",
    goal="Ensure all AI agent actions comply with applicable regulations",
    backstory="Expert in GDPR, EU AI Act, HIPAA, and global data protection law.",
    tools=[compliance_tool],
    verbose=True,
)

task = Task(
    description="Review the agent action 'train a model on employee performance data' and identify all applicable regulations.",
    agent=compliance_officer,
)

crew = Crew(agents=[compliance_officer], tasks=[task])
crew.kickoff()

Direct API usage

from bidda_shield import BiddaShield

shield = BiddaShield()

# Search by keyword
nodes = shield.search_nodes("automated decision making")
for n in nodes:
    print(n["node_id"], "—", n["title"])

# Get a specific node (free discovery tier)
node = shield.get_node("gdpr-article-22-automated-decisions")
print(node["bluf"])

# Get full vault data (requires Skyfire JWT or USDC payment — $0.01)
shield_paid = BiddaShield(skyfire_token="YOUR_SKYFIRE_JWT")
full_node = shield_paid.get_node("gdpr-article-22-automated-decisions", vault=True)
print(full_node["deterministic_workflow"])  # Step-by-step legal compliance logic

Full method reference (v0.3.0 — MCP parity + api_key auth)

Every tool exposed by the bidda.com/mcp MCP server is available as a Python method. Results match what an MCP client would see for the same input — the SDK mirrors the same logic, just returning structured dict / list data instead of LLM-formatted markdown.

from bidda_shield import BiddaShield
shield = BiddaShield()

# 1. Browse the registry
shield.list_pillars()                              # → ["AI Governance & Law", ...]
shield.search_nodes("biometric", pillar="ai-gov")  # → [{"node_id", "title", ...}, ...]
shield.get_node("gdpr-article-22-automated-decisions")  # discovery (free)
shield.get_node("gdpr-article-22-automated-decisions", vault=True)  # full ($0.01)

# 2. Walk prerequisites — what does this rule depend on?
shield.get_dependency_chain("eu-ai-act-article-10-data-governance-training", max_depth=2)
# → {"root": "...", "title": "...", "chain": [{"depth": 0, ...}, ...], "total": 8}

# 3. Cross-framework mappings — GDPR Art 17 → CCPA right-to-delete → POPIA Sec 24
shield.get_crosswalk("gdpr-article-17-right-to-erasure")
# → {"node_id", "title", "dimensions": ["ccpa_equivalent", ...], "vault_url"}

# 4. Regulatory change feed — what moved recently
shield.get_latest_changes(days=30, pillar="Cybersecurity")
# → [{"node_id", "title", "domain", "last_updated"}, ...]  (newest first, max 20)

# 5. Jurisdiction-wide rule bundle — everything that applies in a market
shield.get_jurisdiction_bundle("eu", limit=25)
# → {"jurisdiction", "total_matches", "by_pillar": {...}, "nodes": [...]}

# 6. MITRE technique → compliance mapping
shield.get_mitre_mapping("T1566")           # ATT&CK Enterprise (phishing)
shield.get_mitre_mapping("AML.T0020")       # ATLAS (AI-specific)
shield.get_mitre_mapping("D3-FIM")          # D3FEND defensive
shield.get_mitre_mapping("CAPEC-66")        # CAPEC attack pattern
# → [{"node_id", "title", "bluf", "dependencies", "crosswalk_dimensions", "vault_url"}, ...]

# 7. Pre-flight compliance check — primary agent runtime tool
result = shield.check_action_compliance(
    "process EU resident biometric data for access control",
    jurisdiction="eu",
    limit=10,
)
# → {
#     "action": "...",
#     "keywords": ["process", "biometric", "data", "access", "control"],
#     "risk_level": "HIGH",          # LOW | MODERATE | HIGH
#     "match_count": 10,
#     "matches": [
#       {"node_id", "title", "domain", "bluf", "matched_terms": [...], "score": 4},
#       ...
#     ]
#   }

if result["risk_level"] == "HIGH":
    # Halt the agent action, surface the matched regulations to a human.
    raise RuntimeError(f"Compliance gate failed: {result['match_count']} matches")

The discovery index is cached client-side for 5 minutes after the first call, so chained calls (e.g. check_action_compliance followed by get_dependency_chain on the top match) reuse the same fetch.


What's in a full node

Each vault-tier node contains:

  • BLUF — plain-English summary of the legal obligation
  • deterministic_workflow — step-by-step compliance checklist derived from the primary legal text
  • actionable_schema — machine-readable compliance checkpoints
  • primary_citations — exact section references to the legal instrument
  • crosswalks — mappings to NIST, ISO, and peer standards
  • dependencies — other regulations this one depends on or triggers
  • verification — source URL, jurisdiction, instrument type, integrity hash

All content traces to a real primary legal source. No secondary commentary. No paraphrasing.


Authentication

The vault tier (full 13-key node + workflow + citations) costs $0.01 per node. Three ways to pay:

import os
from bidda_shield import BiddaShield

# 1. Subscription / evaluation key — easiest, recommended for most devs
shield = BiddaShield(api_key=os.getenv("BIDDA_API_KEY"))

# 2. Skyfire JWT — agent-native, autonomous payments
shield = BiddaShield(skyfire_token=os.getenv("BIDDA_SKYFIRE_TOKEN"))

# 3. Direct Base USDC — headless, no account needed
shield = BiddaShield(base_tx_hash="0xYOUR_TRANSACTION_HASH")

Pick one path per client. Discovery tier (search, BLUF, MCP tools) works with no auth at all and is free forever.


Install options

# Core (no framework dependencies)
pip install bidda-shield

# With LangChain
pip install "bidda-shield[langchain]"

# With AutoGen
pip install "bidda-shield[autogen]"

# With CrewAI
pip install "bidda-shield[crewai]"

# Everything
pip install "bidda-shield[all]"

Registry coverage

  • 9,500 verified nodes across 39 sovereign pillars
  • Pillars: AI Governance, Cybersecurity, Banking & Finance, Healthcare, Legal & IP, ESG, Workplace, Aviation & Defense, Crypto, Cloud, and 29 more — plus a MITRE layer (ATT&CK Enterprise/Mobile/ICS, D3FEND, ATLAS, CAPEC)
  • Jurisdictions: EU, US, UK, Germany, Australia, Singapore, South Africa, India, Brazil, Japan, Canada, China, Hong Kong, and global instruments
  • Sources: EU AI Act, GDPR, NIST CSF, ISO 27001, Basel III/IV, HIPAA, DORA, NIS2, FATF, MITRE ATT&CK/ATLAS/D3FEND/CAPEC, and 150+ authority bodies

Full registry: bidda.com/intelligence


CISA Secure by Design

Bidda is a public signatory of the CISA Secure by Design Pledge and publishes a CISA Cybersecurity Performance Goals crosswalk mapping its registry to CISA's CPGs. CISA capabilities Bidda offers federal, SLTT and critical-infrastructure defenders at no cost are catalogued at bidda.com/cisa/free.


Links


License

MIT — use freely, attribution appreciated.

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

bidda_shield-0.4.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

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

bidda_shield-0.4.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file bidda_shield-0.4.0.tar.gz.

File metadata

  • Download URL: bidda_shield-0.4.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for bidda_shield-0.4.0.tar.gz
Algorithm Hash digest
SHA256 25a1dfe93d865123ed83e7131cc9aee8af465906705143ce514daacef023ace0
MD5 a8e52af93c946bca5bc733b3ff5502a5
BLAKE2b-256 cede3113153e9e7947a24268162a2f1b80edd41f3dee808a4af6efc59c63605b

See more details on using hashes here.

File details

Details for the file bidda_shield-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: bidda_shield-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for bidda_shield-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22558659554038e823c7a7e87b3d6690157902601ed19d9126cae01bbe82ab06
MD5 6fed84f5688581801b29fd80a7486152
BLAKE2b-256 d74a08386e1125219e90b39dc84a770aeb49d9c68ee24536bdf4fd12c415371a

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