Metadata-Version: 2.4
Name: scyvera
Version: 1.5.0
Summary: Framework-independent contracts and validation tooling for AI agents and automated workflows.
Author: Shinjan Das
License-Expression: MIT
Project-URL: Homepage, https://github.com/Skull-boy/scyvera
Project-URL: Repository, https://github.com/Skull-boy/scyvera
Project-URL: Issues, https://github.com/Skull-boy/scyvera/issues
Keywords: agent,contracts,governance,validation,schema,specification,automation,workflow
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML<7.0,>=6.0
Requires-Dist: jsonschema<5.0,>=4.20
Provides-Extra: github
Requires-Dist: PyGithub>=2.0.0; extra == "github"
Provides-Extra: qdrant
Requires-Dist: qdrant-client>=1.7.0; extra == "qdrant"
Provides-Extra: all
Requires-Dist: PyGithub>=2.0.0; extra == "all"
Requires-Dist: qdrant-client>=1.7.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: PyGithub>=2.0.0; extra == "dev"
Requires-Dist: qdrant-client>=1.7.0; extra == "dev"
Dynamic: license-file

<div align="center">
  <img src="https://raw.githubusercontent.com/Skull-boy/scyvera/main/assets/scyvera-mark.svg" alt="Scyvera" width="170">

# Scyvera

**Set the boundary once. Get it enforced everywhere. Prove it forever.**

Operational contracts for AI agents: what a system can do, what it can access, and what it must never do — enforced at runtime and provable after the fact.

[![License](https://img.shields.io/github/license/Skull-boy/scyvera)](./LICENSE) [![PyPI](https://img.shields.io/pypi/v/scyvera)](https://pypi.org/project/scyvera/) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/scyvera?period=total&units=INTERNATIONAL_SYSTEM&left_color=RED&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/scyvera) [![npm](https://img.shields.io/npm/v/@scyvera/scyvera-ts)](https://www.npmjs.com/package/@scyvera/scyvera-ts) [![Container](https://img.shields.io/badge/container-ghcr.io-blue)](https://github.com/Skull-boy/scyvera/pkgs/container/scyvera) [![CI](https://github.com/Skull-boy/scyvera/actions/workflows/validate-contracts.yml/badge.svg)](https://github.com/Skull-boy/scyvera/actions/workflows/validate-contracts.yml) [![Blast Radius](https://img.shields.io/badge/blast%20radius-Shielded-green)](#proof-not-promises) [![Docs](https://img.shields.io/badge/docs-quickstart-blue)](./docs/quickstart.md)
</div>

---

MCP and A2A standardize how agents talk to tools and to each other. Scyvera defines the layer above
them: the boundary those agents run inside. The contract is a file — not a prompt — and the same
bytes are enforced by the universal image or by the native Python, TypeScript, and Rust runtimes.

```bash
# any machine with Docker — no Python install, no runtime choice
docker run --rm -v "$PWD:/work:ro" ghcr.io/skull-boy/scyvera:control audit /work

# or use the host CLI
pip install scyvera && scyvera audit .
```

`ghcr.io/skull-boy/scyvera:control` is the full control plane: `audit`, `init`, `validate`, `lint`,
`check`, and `vectors`. `ghcr.io/skull-boy/scyvera:base` adds Python, Node, and Rust toolchains and
runs `scyvera up`. Both are multi-arch (`amd64`/`arm64`) with SBOM and provenance attestations. The
native packages remain for teams that want in-process enforcement or cannot run containers.

## See it run

`docker run --rm -v "$PWD:/work:ro" ghcr.io/skull-boy/scyvera:control audit /work` inside this
repository:

```text
WARN  /work
      Blast Radius: 92/100 (Shielded)
      raw (all findings): 82/100 (Controlled)

      MEDIUM    [AU-N8N-001] n8n workflow with external writes
                implementations/n8n/competitor-feature-parity-watcher/workflow.json:169 + 3 more
      MEDIUM    [AU-NET-002] outbound network calls in source
                implementations/langgraph/duplicate-issue-detector/backfill.py:23 + 1 more

      GOVERNED  [AU-CI-002] deploy or publish job detected
                .github/workflows/publish-scyvera-rs.yml:45 + 1 more
                registry:publish declared and approved in contract.yaml
```

Those publish workflows are this repository's own npm and crates.io releases. They are measured and
**governed, not waived**: `contract.yaml` declares `registry:publish` and requires a named approver,
so the findings leave the governed score, stay visible in the report with `governed_by`, and still
count in the raw number ([RFC 0004 Amendment 2](./rfcs/0004-amendment-2-governed-findings.md)). The
scan is read-only; it did not change a file.

The **TypeScript runtime** gates the same contract with no install — the contract is the artifact,
and every runtime reads the same bytes:

```bash
npx scyvera-ts gate --contract contract.yaml --mode full \
  --action github:issues:read --action-type permission
# ALLOWED  github:issues:read
npx scyvera-ts vectors --root vectors     # 33/33 at suite-version 1
```

![Scyvera in 23 seconds: scan, draft, and a blocked action](https://raw.githubusercontent.com/Skull-boy/scyvera/main/assets/scyvera-demo.gif)

## Quickstart

The command-line steps below have container forms. The host CLI is shown for brevity; the exact
`docker run` equivalents are in [docs/container.md](./docs/container.md).

**1. Scan.** What can this environment actually do?

```bash
docker run --rm -v "$PWD:/work:ro" ghcr.io/skull-boy/scyvera:control audit /work
```

Or on the host:

```bash
scyvera audit .
```

**2. Draft.** The scan writes your first contract; you never start from a blank page.

```bash
scyvera audit . --generate contract.yaml
```

```yaml
version: 1.1
system:
  name: research-agent
permissions: [github:issues:read]
side_effects:
  - {resource: github, type: comment}
approvals:
  - {action: github:comment, required: true}
```

**3. Verify.** The draft is schema-valid and lint-clean by construction.

```bash
scyvera validate contract.yaml && scyvera lint contract.yaml
```

**4. Enforce.** There are two depths, and they compose.

Run one process inside the container boundary — read-only root filesystem, dropped capabilities,
`no-new-privileges`, network denied by default, and no Docker socket:

```bash
scyvera up -- python agent.py
scyvera up --path ./service -- npm start
```

`up` uses the published `:base` image by default. The host CLI generates the flags; without
Python, the equivalent `docker run` form is in [docs/container.md](./docs/container.md).

Or gate calls in-process. Undeclared actions fail closed:

```python
from scyvera import ContractEnforcer

enforcer = ContractEnforcer.load("contract.yaml")

@enforcer.gate("github:issues:read", "permission")
def read_issue(number: int): ...

@enforcer.gate("github:comment", "side_effect")
def comment(number: int, body: str): ...   # requires approval until enforcer.approve(...)
```

The TypeScript and Rust runtimes read the same contract. See [Runtimes](#runtimes).

**5. Expose it to an agent host.** The same engines over MCP, no shelling out:

```bash
scyvera serve-mcp   # five tools over stdio — see docs/mcp.md
```

## Capabilities

| You want to… | Use | Docs |
|---|---|---|
| See what a repo can actually do | `scyvera audit` — deterministic AUxxx scan, Blast Radius bands, badge, CI floor | [Quickstart](./docs/quickstart.md) |
| Run the control plane without a runtime | `docker run ghcr.io/skull-boy/scyvera:control` — no Python, Node, or Rust install | [Containers](./docs/container.md) |
| Turn findings into a boundary | `--generate` drafts a schema-valid v1.1 contract; `--pack` starts from a policy | [Policy Packs](./docs/policy-packs.md) |
| Check code against its contract | `scyvera check` — Tier 0 structural, Tier 1 static (n8n, LangGraph) | [Conformance](./docs/conformance.md) |
| Run one governed process | `scyvera up` — read-only rootfs, dropped caps, no Docker socket | [Containers](./docs/container.md) |
| Gate calls in-process | `ContractEnforcer` (Python), `scyvera-ts` (Node), `scyvera-rs` (Rust) | [Python API](./docs/python-api.md) |
| Bound behavior, not just actions | v1.2 `guardrails` — rate limits, side-effect budgets, fail-closed | [Python API](./docs/python-api.md) |
| Score what an agent actually did | `scyvera eval` — four axes over RFC 0003 traces | [Evals](./docs/evals.md) |
| Prove which contract governed what | Hash-chained registry, time-travel queries, re-seal, human promotion | [Python API](./docs/python-api.md) |
| Expose tools to an agent host | `scyvera serve-mcp` — five MCP tools over stdio | [MCP server](./docs/mcp.md) |
| Gate CI and adopt a runtime | `scyvera-gate` Action, harness skill, per-target kits (n8n, LangGraph) | [Kits](./kits/README.md) |

## How it works

<img src="https://raw.githubusercontent.com/Skull-boy/scyvera/main/assets/hero-flow.svg" alt="Scan, draft, enforce, prove" width="100%">

- **Scan** is pattern-level and review-grade; it tells you what the code can reach, not what it does.
- **Draft** produces one schema-valid contract, the same format hand-authored contracts use.
- **Enforce** is default-deny at two depths: undeclared calls raise in-process, and the container
  boundary removes capabilities the process never had. Every decision can go to an audit trail.
- **Prove** is trace + registry: what ran, under which contract, and whether that contract ever
  changed.

## Runtimes

One standard, one universal image, three native implementations. Every runtime passes the same
shared corpus.

| Artifact | Install | Status | Vectors |
|---|---|---|---|
| **Universal image** | `docker run ghcr.io/skull-boy/scyvera:control` | multi-arch, SBOM + provenance | 33/33 |
| **Python** (reference) | `pip install scyvera` | `1.5.0` on PyPI | 33/33 |
| **TypeScript** | `npm install @scyvera/scyvera-ts` | `0.1.1` on npm, OIDC + SLSA provenance | 33/33 |
| **Rust** | `cargo install scyvera-rs` | `0.1.1` on crates.io — OIDC trusted publishing, human-gated, attested `.crate` | 33/33 |

The images are not a fourth engine: `control` packages the reference control plane, and `base` adds
the three toolchains. A single-runtime user still gets a complete product. `vectors/` is the
acceptance corpus: `suite-version: 1`, 33 vectors across contract-model, gate-decision, and
trace-roundtrip. A runtime that passes a subset is not conformant.

## Use it from your agent host

[`skills/scyvera-governance/`](./skills/scyvera-governance) is an Agent Skill: it teaches a host to
run the CLI and the MCP tools and to report their verdicts unchanged. It grants no authority — the
engines still decide, and a misbehaving agent is caught by the same exit codes.

Copy the folder into the host's skills directory, keeping its name:

| Host | Project path | Global path | Invoke with |
|---|---|---|---|
| **Claude Code** | `.claude/skills/` | `~/.claude/skills/` | `/scyvera-governance` |
| **Codex** | `.agents/skills/` | `~/.agents/skills/` | `$scyvera-governance` |
| **OpenCode** | `.opencode/skills/` or `.agents/skills/` | `~/.config/opencode/skills/` | `@scyvera-governance` |
| **Antigravity** | `.agents/skills/` | `~/.gemini/config/skills/` | `/scyvera-governance` |

```bash
git clone --depth 1 https://github.com/Skull-boy/scyvera /tmp/scyvera

cp -R /tmp/scyvera/skills/scyvera-governance .agents/skills/   # Codex, OpenCode, Antigravity
cp -R /tmp/scyvera/skills/scyvera-governance .claude/skills/    # Claude Code

pip install scyvera   # the skill drives the CLI; it does not bundle a runtime
scyvera --version
```

On Windows, copy the folder by hand. The skill is self-contained (no network, no secrets, no
`sudo`), hash-locked in `skills-registry.json`, and the same `SKILL.md` works in all four hosts.
If your host prefers MCP over skills, register `scyvera serve-mcp` instead — the same five tools
are there ([docs/mcp.md](./docs/mcp.md)).

## Proof, not promises

- **33/33** vectors at suite-version 1 — Python, TypeScript, and Rust, in their own CI.
- **92/100 `Shielded`** is this repository's own governed audit score, with **raw 82/100
  `Controlled`** always reported beside it. Both numbers and the exact scored/governed surface are
  pinned by a covenant test; they move only through an RFC amendment.
- **Published images**: `:control` and `:base` are on GHCR for `amd64` and `arm64`, with SBOM and
  provenance attestations. The publish command builds multi-arch and signs the image digest.
- **The container path is tested**: CI builds both images, runs `scyvera up` in place, and runs the
  host-to-container `scyvera up` flow against `:base`.
- **[Performance](./docs/performance.md)** on generated 1,000–50,000-file corpora: method,
  hardware class, cache state, and every requested row, all measured.
- **Signed installs**: `scyvera self-check` verifies 39 shipped files, and releases carry Sigstore
  build provenance plus a CycloneDX 1.5 SBOM.
- **Same suite everywhere**: Linux and Windows on Python 3.10–3.14 gate every pull request (10
  cells, `fail-fast: false`); macOS runs all five versions in a
  [nightly job](.github/workflows/macos-nightly.yml). macOS is not on the merge gate because its
  hosted runners were failing ~45% of the time (measured 2026-11-24) — a gate that random is not a
  gate. The two sets together are still the full 15-cell matrix.

## Honest limits

1. **Gate bypass at call sites (T4)** — enforcement happens at `@enforcer.gate(...)`. Use the gateways
   so credentials and raw clients stay private, and `assert_gated()` in integration tests.
2. **Third-party internals (T6)** — Scyvera verifies declared intent, not a library's background
   calls. There is no bytecode or packet inspection.
3. **Pre-load tampering (T5)** — integrity checks are post-load. The registry, identity pinning, and
   re-seal cover history; they cannot prove a file was clean before it was read.
4. **Install integrity is not a sandbox (T11)** — `self-check` verifies the installed package, not
   your interpreter, your site-packages, or code installed beside it.
5. **The container is a boundary, not a dependency builder** — `scyvera up` runs the command against
   the mounted workspace; v0 does not install project dependencies or build a derived app image. It
   validates the contract but does not yet interpret permissions, approvals, or budgets. A process
   outside the image is outside the boundary; never mount the Docker socket into the agent.
6. **Governed is not waived (governed findings)** — a finding your contract declares *and* approves
   leaves the governed score but stays in the report with `governed_by`, and `raw_score` always shows
   what it would be. A provisional contract, an undeclared permission, `required: false`, or a
   nameless approver governs nothing.

Full threat models: [`lifecycle`](./docs/threat-model-lifecycle.md) ·
[`enforcer`](./docs/threat-model-enforcer.md) · [`distribution`](./docs/threat-model-distribution.md).

## Documentation

| Start | Go deeper |
|---|---|
| [Quickstart](./docs/quickstart.md) — audit → draft → enforce | [Containers](./docs/container.md) — images, `up`, publishing |
| [Install & verify](./docs/install.md) — platforms, `self-check`, attestations | [Python API](./docs/python-api.md) — enforcer, gateways, registry, re-seal |
| [Contract reference](./docs/contract-reference.md) — field-by-field | [Conformance](./docs/conformance.md) — tiers and `T101`–`T103` |
| [MCP server](./docs/mcp.md) — host config, five tools | [Evals](./docs/evals.md) — case format and scoring axes |

Background: [vision](./docs/vision.md) · [design principles](./docs/design-principles.md) ·
[architecture](./docs/architecture.md) · [RFCs](./rfcs) · [SPEC](./WORKFLOW-CONTRACT-SPEC.md).

## Contributing

Contributions are welcome: audit rules with fixtures, Policy Packs, framework reference
implementations, runtime work, and documentation. Start with
[CONTRIBUTING.md](./CONTRIBUTING.md) and the
[`good first issue`](https://github.com/Skull-boy/scyvera/labels/good%20first%20issue) label.

If Scyvera is guarding something real in your stack, add yourself to [ADOPTERS.md](./ADOPTERS.md) —
the honest version of a logo wall.

Security issues: [SECURITY.md](./SECURITY.md).

## License

MIT — see [LICENSE](./LICENSE). Maintained by [Shinjan Das](https://github.com/Skull-boy) and
open-source contributors; see [CONTRIBUTORS.md](./CONTRIBUTORS.md).
