Metadata-Version: 2.4
Name: boundri-policy-ir
Version: 1.0.0rc1
Summary: Boundri's open rule schema and offline checks for signed rule sets and decision logs.
License-Expression: Apache-2.0
Project-URL: Homepage, https://boundri.ai
Project-URL: Documentation, https://docs.boundri.ai
Project-URL: Repository, https://github.com/boundrihq/boundri
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Requires-Dist: cryptography>=42.0
Requires-Dist: regopy>=1.5
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: import-linter>=2.0; extra == "dev"
Dynamic: license-file

# boundri-policy-ir

Apache-2.0 shared schema and verification primitives for Boundri. It is the
base of the dependency graph: `boundri-cli` and `boundri-sdk` both build on it,
and the hosted server re-exports parts of it rather than keeping a second copy.

```bash
pip install boundri-policy-ir
```

## Why it is a separate, permissive package

Anything a third party must be able to reproduce byte-for-byte lives here, so
reproducing it never requires source-available code:

- **Bundle signatures.** `bundle_signature` canonicalises a manifest core and
  verifies its Ed25519 signature; `local_signer` produces the same envelope.
- **Audit chain.** `audit_chain` holds the canonical-bytes, entry-hash and
  Merkle recompute used to re-derive a chain checkpoint offline.
- **Verification packs.** `verification_pack` reads the offline bundle a
  publisher ships, and `trust_anchor` / `trust_store` resolve the key it is
  checked against.
- **Policy pack promotion.** `promotion` parses the signed `promotion` block
  that names a published policy pack and its pinned regulation floor.

The server's `boundri_server.services.audit.{canonical,merkle}` and
`...distribution.signer.sign` are shims over the functions here. They are one
implementation with two names, never a fork: a structural test fails the build
on a second copy of the envelope recipe anywhere under `packages/`.

## Runtime input contract

`evaluation_input` is the single declaration of which input roots a compiled
policy may reference at evaluation time: `principal`, `action`, `resource`,
`parameters`, `context`. A rule that binds on anything else is undefined in
Rego, which means it compiles clean and can never fire, so the compiler refuses
it against this declaration rather than shipping a rule that silently does
nothing.

## Licence

Apache-2.0. See [LICENSE](LICENSE) and
[docs/architecture/licensing-target.md](https://github.com/boundrihq/boundri/blob/main/docs/architecture/licensing-target.md)
for the monorepo's per-package split.
