Metadata-Version: 2.4
Name: netzilo
Version: 4.2.0
Summary: Netzilo AI Detection & Response (AIDR) — governance for Python AI agents.
Author: Netzilo
License: Proprietary
Project-URL: Homepage, https://www.netzilo.com
Keywords: ai,agent,governance,security,aidr,netzilo
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: crewai
Requires-Dist: crewai; extra == "crewai"
Provides-Extra: langgraph
Requires-Dist: langgraph; extra == "langgraph"
Provides-Extra: autogen
Requires-Dist: autogen-core; extra == "autogen"

# netzilo (Python)

Netzilo AI Detection & Response(AIDR) for Python

Provides full governance for custom AI agents written in Python

## How it works

The Netzilo client is compiled to a native shared library and loaded **in-process**
via `ctypes`. Every LLM prompt, model response, and tool call your agent makes can
be evaluated — allowed, blocked, or redacted — against policy pulled live from your
Netzilo management server. No daemon, no sidecar, no proxy to stand up.

## Install

```bash
pip install netzilo
```

Wheels are published per platform (Linux, macOS, Windows) and are independent of
your Python version.

## Core API

```python
import netzilo

netzilo.start(server="https://srv.netzilo.com",   # management server
              pat="nzl_...",                       # or setup_key="..."
              agent_name="my-agent")               # non-blocking

netzilo.is_running()                       # -> bool: True once policy has synced (ready to govern)
netzilo.mcp_gateway_port()                 # -> int: scanner port in use (auto-picked)
netzilo.socks5_port()                      # -> int: SOCKS5 proxy port in use (auto-picked)
allowed, reason = netzilo.is_allowed("Bash", {"command": "rm -rf /"})
netzilo.report_result("Bash", "<stdout>")  # post-tool observability
netzilo.flush()                            # force-deliver buffered events to management
netzilo.stop()                             # graceful stop (flushes events; auto-registered atexit)
```

Parameters may be passed as keyword args (above) or a single `config` dict.
`config_path` defaults to `~/.netzilo-sdk/config.json`; the scanner and SOCKS5
ports auto-pick free ports (governance on by default). `is_running()` returns
`True` only after the initial policy sync — poll it before kicking off work.

Evaluation runs **inside the process** — `evaluate()` calls the embedded engine
directly, with no HTTP roundtrip and no local port to manage.

## Framework adapters

Adapters are **submodules of the one `netzilo` package** — no separate installs.
Each is a single call. The framework is imported lazily inside the adapter, so
`pip install netzilo` never pulls crewai/langgraph/autogen unless you use it.

```python
# CrewAI — registers before/after tool and LLM hooks process-wide
from netzilo.crewai import govern
govern(config={...})

# LangGraph — wrap nodes before compile()
import netzilo.langgraph
netzilo.langgraph.govern(graph, config={...})

# AutoGen — intervention handler
from netzilo.autogen import handler
runtime = SingleThreadedAgentRuntime(intervention_handlers=[handler(config={...})])
```

Optional convenience extras pull a framework alongside netzilo:
`pip install netzilo[crewai]`, `netzilo[langgraph]`, `netzilo[autogen]`.

## Configuration

`start()` / `govern()` accept a config dict. Common keys:

| Key | Description |
|-----|-------------|
| `server` | Your Netzilo management server URL. (`management_url` is a legacy alias.) |
| `pat` / `setup_key` | Credential used to enroll the agent. |
| `agent_name` | Identifier this agent reports as (used for event attribution). |
| `config_path` | Local client state (default: `~/.netzilo-sdk/config.json`). |
| `mcp_gateway_port` / `socks5_port` | Optional; default to auto-picked free ports. `mcp_gateway_port=0` disables governance. |
| `log_level` / `log_file` | Logging verbosity and destination. |

## Notes

- The native library is bundled inside the wheel; pip selects the correct one
  for your platform automatically. Adapters ship inside the same wheel as
  submodules — a single distribution, not per-framework packages.
- For local development against a locally built library, set `NETZILO_LIB_PATH`
  to its path.

Netzilo is a commercial product. See <https://www.netzilo.com>.
