Problem
connect() unconditionally configures set_pip_config() with a derived PDP endpoint (Step 7), causing _evaluate_org_policy() to attempt an HTTP POST to /v1/pdp/evaluate on every ALLOW path — even when the embedded Go binary PDP is already handling policy enforcement via CAPISCIO_BUNDLE_URL.
This creates two problems:
- Redundant enforcement layers — the Python SDK and the Go binary both try to evaluate org policy, duplicating work
- Noisy warnings — when no registry server is running (e.g., local/demo setups using the embedded PDP), every ALLOW call logs
PDP unavailable during org-policy check before falling through
The warning is harmless (inline badge check already passed, so fail-open is correct), but it indicates a design gap: the Python SDK shouldn't be trying to reach a server-side PDP when enforcement is already handled by the embedded Go binary.
Observed in
Demo scenario with embedded Go PDP (CAPISCIO_BUNDLE_URL set). Phase 1 and Phase 3 ALLOW calls for trusted agents all show the PDP warning.
Proposed fix
In connect.py Step 7, detect when the Go binary is the PDP (e.g., CAPISCIO_BUNDLE_URL is set in env, meaning local OPA is active) and skip set_pip_config(). The enforcement boundary should be:
- Python SDK: badge validation (inline trust level, allowed tools)
- Go binary: PDP evaluation (org policy via OPA)
- Neither duplicates the other's work
Alternative: add an explicit enable_org_policy: bool = True parameter to connect() so callers can opt out when using the embedded PDP path.
Related
Problem
connect()unconditionally configuresset_pip_config()with a derived PDP endpoint (Step 7), causing_evaluate_org_policy()to attempt an HTTP POST to/v1/pdp/evaluateon every ALLOW path — even when the embedded Go binary PDP is already handling policy enforcement viaCAPISCIO_BUNDLE_URL.This creates two problems:
PDP unavailable during org-policy checkbefore falling throughThe warning is harmless (inline badge check already passed, so fail-open is correct), but it indicates a design gap: the Python SDK shouldn't be trying to reach a server-side PDP when enforcement is already handled by the embedded Go binary.
Observed in
Demo scenario with embedded Go PDP (
CAPISCIO_BUNDLE_URLset). Phase 1 and Phase 3 ALLOW calls for trusted agents all show the PDP warning.Proposed fix
In
connect.pyStep 7, detect when the Go binary is the PDP (e.g.,CAPISCIO_BUNDLE_URLis set in env, meaning local OPA is active) and skipset_pip_config(). The enforcement boundary should be:Alternative: add an explicit
enable_org_policy: bool = Trueparameter toconnect()so callers can opt out when using the embedded PDP path.Related
_evaluate_org_policy()and auto-configuredset_pip_config()inconnect()