pfc-core
pfc-core provides the shared building blocks used by the adapter packages in
this repository. It contains the PFC client, payload helpers, and enforcement
primitives that power execution-boundary decisions.
What It Does
- Sends execution-boundary evaluation requests to PFC
- Builds consistent decision payloads for adapter packages
- Raises a shared blocked exception when PFC denies execution
Install
From this monorepo:
pip install -e ./packages/pfc_core
Quick Start
from pfc_core.client import PFCClient
from pfc_core.models import build_payload
from pfc_core.middleware import enforce
client = PFCClient("pfc_test_key")
payload = build_payload("demo_tool", {"value": 1}, "policy-123", framework="custom")
decision = {"allow": True, "decision_id": "demo", "receipt_hash": "receipt"}
print(payload)
print(enforce(decision))
How It Works
build_payloadcreates a normalized execution request structure.PFCClientsends that payload to the configured PFC API endpoint.enforceraises when a returned decision blocks execution.
Failure Behavior
PFCClientraises an exception if the API request fails or returns a non-200 response.enforceraisesPFCBlockedErrorwhenallowis falsey.
Limitations
- This package is intentionally small and does not manage framework-specific wrappers.
- It assumes the caller is responsible for constructing appropriate framework context.
- It does not bundle retries, tracing, or policy authoring features.
Metadata
Release files for pfc-core 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pfc_core-0.1.0.tar.gz | 2.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pfc_core-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 kB
Release files / pfc_core-0.1.0.tar.gz
| Download URL | pfc_core-0.1.0.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c49bcf83a8f4b5b825a09944aa0dd0fb05070fc5daa1147c180ef548432f1fd
|
|
BLAKE2b-256 checksum How to use checksums |
590850c67453ccf91018ce38811b5d211df3812e31c6a87db73c318aa52ad289
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0
|
Release files / pfc_core-0.1.0-py3-none-any.whl
| Download URL | pfc_core-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fb79899bdb4fdf79eddb18fcf8d42ce033346f471652be0afbbd6e6229d172b
|
|
BLAKE2b-256 checksum How to use checksums |
792630c0883330c39517757d276c269c250e82044dcbf40e522d99565a1ddc55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0
|