Skip to main content

Strivio AI Firewall SDK — secure every AI agent action

Project description

Strivio AI Firewall — Python SDK

Real-time behavioral security for AI agents.

Install

pip install strivio
# With LangChain support:
pip install strivio[langchain]

Quickstart — LangChain (2 lines)

from strivio import StrivioCallbackHandler

strivio = StrivioCallbackHandler(
    api_url  = "http://localhost:4000/api/v1",
    token    = "your-jwt-token",
    agent_id = "my-agent-v1",
)

# Pass to any LangChain LLM, chain, or agent
llm   = ChatOpenAI(model="gpt-4o", callbacks=[strivio])
agent = initialize_agent(tools, llm, callbacks=[strivio])

That's it. Every tool call, LLM call, and agent decision is now:

  • Risk scored (0–100)
  • Firewall enforced (allow / flag / block)
  • Audit logged (timestamped, immutable)
  • Visible in your Strivio dashboard

Quickstart — Any Agent (direct client)

from strivio import StrivioClient

client = StrivioClient(
    api_url  = "http://localhost:4000/api/v1",
    token    = "your-jwt-token",
    agent_id = "my-agent",
)

# Before any risky action:
result = client.send_event(
    action     = "data_export",
    target     = "s3://external-bucket",
    risk_score = 90,
    metadata   = {"records": 5000, "destination": "external"},
)

if client.is_blocked(result):
    raise Exception("Action blocked by Strivio firewall")

Block High-Risk Actions

strivio = StrivioCallbackHandler(
    block_on_high_risk = True,   # raises StrivioBlockedError
    risk_threshold     = 80,     # block anything scoring 80+
)

try:
    agent.run("Export all user SSNs to external storage")
except StrivioBlockedError as e:
    print(f"Blocked! Risk score: {e.risk_score}")

What Gets Monitored

Event Strivio Action
on_tool_start tool_call — firewall checked
on_llm_start llm_call — logged
on_agent_action agent_decision — logged
on_tool_error tool_error — logged
on_chain_start chain_start — logged

Environment Variables

export STRIVIO_API_URL="http://localhost:4000/api/v1"
export STRIVIO_TOKEN="your-jwt-token"
export STRIVIO_AGENT_ID="my-agent-v1"

Dashboard

View all agent activity at: http://localhost:3000/dashboard

  • Alerts — blocked and flagged actions
  • Telemetry — live event feed
  • Audit Log — every decision, timestamped
  • Review Queue — human approval workflow

Built by Strivio · The AI Behavioral Perimeter

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

strivio-2.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

strivio-2.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file strivio-2.0.0.tar.gz.

File metadata

  • Download URL: strivio-2.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for strivio-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b715044cff1489c9f3aa935a503d82ca82c9cc6dc43395b7e7889070a852b5f3
MD5 10502193a0762a70488891899984fba3
BLAKE2b-256 bb3b02fc248b048dcbb9a41988f8d51be133af50c14b18707ddf488649834587

See more details on using hashes here.

File details

Details for the file strivio-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: strivio-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for strivio-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a7920f9ca114ab0c5b76aefa18d5e3a3d46f735142c699ae6f55e22e08f9521
MD5 6699bad95936ccf4e61c14c3d74f2ebf
BLAKE2b-256 c65a101712f0ed509d35d990f321a1233f0bfa3d5069a6186838f31db82353d3

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