Skip to main content

fazflow-policy-gate

Decide cada ação de um agente de IA antes que ela aconteça, e registra a decisão numa cadeia verificável.

A decisão é local: o motor roda dentro do seu processo, e os argumentos da requisição nunca saem da sua infraestrutura.

Instalar

pip install fazflow-policy-gate

O artefato WebAssembly viaja dentro do pacote. Não há passo de download.

Usar

from fazflow_policy_gate import PolicyGate

gate = PolicyGate.load()
gate.load_bundle({"versao": "v1", "politicas": fonte_cedar})

d = gate.evaluate({
    "user": 'User::"u_8891"',
    "agent": 'Agent::"copiloto"',
    "action": "Tool::query",
    "resource": 'Dataset::"notas"',
    "context": contexto,   # os 14 campos
    "entities": entidades, # User, Agent, Workload e o recurso
})

if d["verdict"] == "Deny":
    raise RuntimeError(d["reason_code"])

Duas camadas

A política é avaliada em duas camadas — a do usuário e a do agente — e as duas precisam permitir. Uma política só com principal is Agent responde Deny com DeniedNoUserPermit, e é o erro mais comum do primeiro dia.

Obrigações

Quando o veredito é Transform, d["obligations"] traz o que precisa ser feito — mascarar:cpf,email, truncar:100. Aplicá-las é responsabilidade de quem chamou. O SDK não toca no dado: ele não viu o conteúdo e não está no caminho da resposta.

Ignorar uma obrigação é o modo de falha mais silencioso do sistema: o log registra que a máscara foi exigida, a auditoria vê que foi exigida, e o dado saiu inteiro.

Concorrência

Cada instância WASM é single-threaded. Sob concorrência use PolicyGatePool, que mantém uma instância por thread lógica. Não chame métodos da instância crua enquanto outra thread avalia — os buffers são compartilhados.

O hash

gate.version()["artefato_hash"] é o sha256 do artefato que foi de fato instanciado, e é o mesmo valor que entra em cada decisão como engine_hash. Compará-lo com o que o painel mostra prova que o binário que decidiu é o que você conferiu.

Licença

Apache-2.0

Metadata

Release files for fazflow-policy-gate 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fazflow-policy-gate 0.1.5
File Size Uploaded Provenance Actions
fazflow_policy_gate-0.1.5.tar.gz 1.5 MB With provenance Details for fazflow_policy_gate-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fazflow-policy-gate 0.1.5
File Interpreter ABI Platform Actions
fazflow_policy_gate-0.1.5-py3-none-any.whl Python 3 none any Details for fazflow_policy_gate-0.1.5-py3-none-any.whl

Total release size: 2.9 MB

Release files / fazflow_policy_gate-0.1.5.tar.gz

Download URL fazflow_policy_gate-0.1.5.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
85230481b843c3dfde44ced3aa3be4322c1f26a2cd270f0cb63fcdc6421b0969
BLAKE2b-256 checksum
How to use checksums
07eaddf4c847f1809d385bdb622ae02448de94fb0fcf679eb604df20e5708370
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / fazflow_policy_gate-0.1.5-py3-none-any.whl

Download URL fazflow_policy_gate-0.1.5-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
589c082d6c3220a17f568b62e54a46e7885fa7c9cfc9b870e904335a3bec9844
BLAKE2b-256 checksum
How to use checksums
43b73748e48ec73ce7db0c832c8c6cb8db0dcafdbfb22377dc0824b26f2d1956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Security for fazflow-policy-gate 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fazflow_policy_gate-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page