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.4

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.4
File Size Uploaded Provenance Actions
fazflow_policy_gate-0.1.4.tar.gz 1.5 MB With provenance Details for fazflow_policy_gate-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 2.9 MB

Release files / fazflow_policy_gate-0.1.4.tar.gz

Download URL fazflow_policy_gate-0.1.4.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
ece877bdf18b0d2e5d2cf79022728a4b29fdbf127eccf6eedcd07b2eaf440f5c
BLAKE2b-256 checksum
How to use checksums
526796ae83bafd99e659b66778098969ba6542212572a8c63ae21fb5ed30df34
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.4-py3-none-any.whl

Download URL fazflow_policy_gate-0.1.4-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dd642d461079990f0774e0d9447113adeeba1b4a5ccdbfb7f5fd18639e955144
BLAKE2b-256 checksum
How to use checksums
a5e897139b9a4bb07afb8cd17ec89db368f4f5cd73b0e074e140e2b0ca1bbebd
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.4

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.4.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