Skip to main content

Runtime interception SDK for AI agent governance

Project description

rends-agent-sdk

Runtime interception SDK for AI agent governance. Wraps agent tool calls with synchronous policy enforcement via the AgentCompliant/Rends platform.

Install

pip install rends-agent-sdk

# With framework adapters
pip install "rends-agent-sdk[langchain]"
pip install "rends-agent-sdk[crewai]"
pip install "rends-agent-sdk[autogen]"
pip install "rends-agent-sdk[all]"

Quick Start

from rends_sdk import RendsClient, RendsClientConfig, ActionContext

async with RendsClient(RendsClientConfig(
    api_key="ac_live_...",
    org_id="your-org-uuid",
    agent_id="your-agent-uuid",
    mode="enforce",  # "enforce" | "monitor" | "dry-run"
)) as client:
    result = await client.govern(
        ActionContext(
            action_type="database_query",
            action_name="select_users",
            resource_type="customer_records",
            input_summary="SELECT * FROM users WHERE region = us-east-1",
        ),
        tool_fn=lambda params: db.query("SELECT * FROM users"),
    )
    # result.allowed, result.status, result.result, result.check.violations

LangChain Integration

from rends_sdk.adapters import govern_langchain_tool

governed = govern_langchain_tool(client, search_tool, resource_type="web_search")
agent = create_react_agent(llm, tools=[governed])

CrewAI Integration

from rends_sdk.adapters import govern_crewai_tool

search = SerperDevTool()
governed = govern_crewai_tool(client, search, resource_type="web_search")
agent = Agent(tools=[governed], ...)

AutoGen Integration

from rends_sdk.adapters import govern_autogen_tool

def search_web(query: str) -> str:
    return tavily.search(query)

governed = govern_autogen_tool(client, search_web, "search_web", resource_type="web_search")
agent.register_function(function_map={"search_web": governed})

Enforcement Modes

Mode Behavior
enforce BLOCK → raises GovernanceBlockError, PASS/WARN → executes
monitor All decisions logged but never block execution
dry-run Policy checked, nothing executed, nothing logged

Pre-flight Check

check = await client.check_policy(ActionContext(
    action_type="data_export",
    action_name="export_pii",
    resource_type="user_data",
    input_summary="Export all PII to CSV",
))
# check.allowed, check.status, check.violations

Pipeline Stages

The SDK runs a 5-stage pipeline on every govern() call:

  1. beforeAction — validates action shape, computes input hash
  2. policyCheck — calls POST /v1/compliance/check-action synchronously
  3. decisionReturn — parses { allowed, status, violations, warnings }
  4. executionGate — executes tool if allowed, raises if blocked (in enforce mode)
  5. telemetryEmit — logs to POST /v1/telemetry/ingest (hash-chained audit trail)

Configuration

Field Type Default Description
api_key str required API key (ac_live_...)
org_id str required Organization UUID
agent_id str required Agent UUID
endpoint str https://agentcompliant.ai/api API base URL
mode str enforce Enforcement mode
timeout_ms int 10000 Policy check timeout
retries int 2 Retry count for transient failures
fail_open bool False Allow action if policy check fails

License

MIT

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

rends_agent_sdk-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

rends_agent_sdk-1.0.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file rends_agent_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: rends_agent_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for rends_agent_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e6752351cf1f93d7d66bf773038b0257554bbff150647fcfde1e65b38acbbef
MD5 eb72fa16dd8fb3787c08f69596054ae6
BLAKE2b-256 75b6fa2de49e8ab0d2237c479ab7b7267198d84d5c9e0f82739494369efb17a8

See more details on using hashes here.

File details

Details for the file rends_agent_sdk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rends_agent_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ec7eec1a63970cd887d49b86198efe863e191192606692a9e1591d02bb9d402
MD5 14d9072b5d6581c871b3a1e78e7a32f9
BLAKE2b-256 49c54e01f9bc7aa7da83fbd93c1ccf19513e7557a69c7b4759a8f83cfd66bf4c

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