# Zin ADK — Agent Development Kit for Cybersecurity

> **Build, deploy, and govern autonomous cybersecurity agents.**

[![PyPI version](https://badge.fury.io/py/zin-adk.svg)](https://badge.fury.io/py/zin-adk)
[![Python](https://img.shields.io/pypi/pyversions/zin-adk.svg)](https://pypi.org/project/zin-adk/)
[![License](https://img.shields.io/badge/license-Proprietary-red.svg)](https://zeron.one)

ZIA provides a unified platform for building cybersecurity agents with bounded autonomy, policy enforcement, and full auditability — out of the box.

---

## Install

```bash
pip install zin-adk

# With REST API support
pip install "zin-adk[api]"

# With graph database support (Python ≤ 3.13)
pip install "zin-adk[graph]"
```

## Quick Start

```bash
# Scaffold a new agent
zia init --name "Vuln Triage Agent" --domain appsec --out ./agents

# Implement agents/vuln_triage_agent.py → execute()

# Validate
zia validate agents/vuln-triage-agent.yaml

# Run
zia run agents/vuln-triage-agent.yaml --tenant acme

# Or start the REST API
zia serve --host 0.0.0.0 --port 8000
```

## What's included

| Component | What it does |
|---|---|
| **US-ADSL** | YAML DSL for declarative agent definitions — schema-validated |
| **Agent Runtime** | Lifecycle management (`pre_run → execute → post_run`) |
| **Policy Engine** | 6-rule in-process guardrails enforced on every tool call |
| **Tool Substrate** | `@zia_tool` decorator — policy-aware, auditable tool execution |
| **Agent Registry** | `@register_agent` — domain-based discovery and dispatch |
| **SIF Graph** | Time-aware security knowledge graph (Kuzu, namespace-isolated per tenant) |
| **Multi-tenancy** | Tenant isolation from day one — no leakage possible |
| **REST API** | FastAPI layer for portal and SIEM integration |
| **CLI** | `zia init` · `zia validate` · `zia run` · `zia serve` |

## Supported Agent Domains

| Domain | Use case |
|---|---|
| `risk_quant` | Continuous risk scoring, FAIR-like modelling |
| `supply_chain` | Vendor posture, SBOM risk, 3rd-party exposure |
| `red_team` | Autonomous red teaming, attack path discovery |
| `appsec` | SAST, DAST, IaC scanning, dependency analysis |
| `ai_security` | Prompt risk, model exposure, LLM guardrail validation |
| `compliance` | Control monitoring, evidence collection, drift detection |

## Build an agent in 3 steps

**1. Define it**

```yaml
# agents/my-agent.yaml
agent:
  id: my-agent
  domain: appsec
  version: "1.0.0"
intent:
  goal: "Triage open vulnerabilities by severity"
reasoning:
  mode: rule_based
  autonomy_level: bounded
capabilities:
  tools: [list_vulnerabilities]
boundaries:
  allowed_actions: [agent_execute, list_vulnerabilities]
safety:
  sandbox_profile: standard
  audit_level: standard
```

**2. Implement it**

```python
from zia.core.runtime.agent import AgentContext, AgentResult, BaseAgent
from zia.core.runtime.registry import register_agent
from zia.core.tools.substrate import ToolExecutor
import zia.core.tools.builtins as tools

@register_agent(domain="appsec")
class MyAgent(BaseAgent):
    def execute(self, context: AgentContext) -> AgentResult:
        vulns = ToolExecutor.call(tools.list_vulnerabilities, context=context)
        critical = [v for v in vulns if v.get("severity") == "critical"]
        return AgentResult.ok(context, output={"critical_count": len(critical)})
```

**3. Run it**

```bash
zia run agents/my-agent.yaml --tenant acme
```

## REST API

```bash
zia serve --host 0.0.0.0 --port 8000

# Create tenant
curl -X POST http://localhost:8000/tenants \
  -H "X-API-Key: your-key" \
  -d '{"tenant_id": "acme", "name": "Acme Corp"}'

# Trigger agent run
curl -X POST http://localhost:8000/tenants/acme/runs \
  -H "X-API-Key: your-key" \
  -d '{"domain": "risk_quant", "environment": "staging"}'

# Interactive API docs
open http://localhost:8000/docs
```

---

**Zeron © 2026** — [zeron.one](https://zeron.one)
