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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pfc_core-0.1.0.tar.gz
(2.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pfc_core-0.1.0.tar.gz.
File metadata
- Download URL: pfc_core-0.1.0.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c49bcf83a8f4b5b825a09944aa0dd0fb05070fc5daa1147c180ef548432f1fd
|
|
| MD5 |
05c23c89bc4ffa97af4eae117e7a277d
|
|
| BLAKE2b-256 |
590850c67453ccf91018ce38811b5d211df3812e31c6a87db73c318aa52ad289
|
File details
Details for the file pfc_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pfc_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb79899bdb4fdf79eddb18fcf8d42ce033346f471652be0afbbd6e6229d172b
|
|
| MD5 |
267ea2ab305496afd02d19d582e1e5a7
|
|
| BLAKE2b-256 |
792630c0883330c39517757d276c269c250e82044dcbf40e522d99565a1ddc55
|