feat: Rego WASM governance — wire models, platform service, CLI bootstrap#1807
Draft
evanbijoy251 wants to merge 3 commits into
Draft
feat: Rego WASM governance — wire models, platform service, CLI bootstrap#1807evanbijoy251 wants to merge 3 commits into
evanbijoy251 wants to merge 3 commits into
Conversation
Adds HookBundle and AllPoliciesResponse Pydantic wire models for
the /all-policies/{tenant_id} endpoint alongside PolicyResponse.
Adds REGO_FEATURE_FLAG / is_rego_enabled() mirroring the existing
GOVERNANCE_FEATURE_FLAG / is_governance_enabled() pattern.
Bumps uipath-core to 0.5.31.
Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Adds retrieve_all_policies() / retrieve_all_policies_async() to fetch
WASM bundle metadata from /all-policies/{tenant_id}, and
download_bundle() / download_bundle_async() for CDN downloads
(no platform auth — pre-signed URLs). Re-exports HookBundle and
AllPoliciesResponse from uipath.platform.governance.
Bumps uipath-platform to 0.2.7.
Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Adds REGO_FEATURE_FLAG gate to resolve_governance(): when EnablePythonGovernanceRegoEvaluator is on, calls build_rego_evaluator_async(sdk.governance) and passes the result into GovernanceBootstrap.wrap_runtime() → UiPathGovernedRuntime. Mirrors the native evaluator bootstrap pattern exactly. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
End-to-end plumbing for the Rego/WASM governance evaluator across three packages:
uipath-core — wire models + feature flag
HookBundleandAllPoliciesResponsePydantic models for the/all-policies/{tenant_id}endpoint, alongsidePolicyResponseREGO_FEATURE_FLAG = "EnablePythonGovernanceRegoEvaluator"andis_rego_enabled()mirroring the existingGOVERNANCE_FEATURE_FLAG/is_governance_enabled()pattern exactlyuipath-platform — GovernanceService methods
retrieve_all_policies()/retrieve_all_policies_async()— GET/{org}/agenticgovernance_/api/v1/all-policies/{tenant_id}download_bundle()/download_bundle_async()— plain httpx GET to pre-signed CDN URLs (no platform auth)uipath (CLI) — governance bootstrap wiring
GovernanceBootstrap.rego_evaluatorfield addedwrap_runtime()passes it toUiPathGovernedRuntimeresolve_governance()callsbuild_rego_evaluator_async(sdk.governance)whenis_rego_enabled()— no background threads, same inline pattern as the native evaluatorCommits
feat: add Rego wire models and feature flag to core— uipath-core 0.5.31feat: add retrieve_all_policies and download_bundle to GovernanceService— uipath-platform 0.2.7feat: wire Rego evaluator into governance CLI bootstrapDependencies
Depends on
UiPath/uipath-runtime-python#feat/rego-evaluator-v2forRegoEvaluatorandbuild_rego_evaluator_async.Test plan
uv run pytest packages/uipath-platform/tests/services/test_governance_service.py— 59 tests passUIPATH_FEATURE_EnablePythonGovernanceRegoEvaluator=true uipath run agent.pytriggers Rego bootstrapUIPATH_ORGANIZATION_ID/UIPATH_TENANT_ID→ValueErrorfromretrieve_all_policieshttpx.HTTPStatusErrorfromdownload_bundleGenerated with Claude Code
Development Packages
uipath
uipath-core