Skip to content

[FEATURE]: APL + Cedarling integration as built-in plugins #23

Closed

Description

@terylt

Epic: CPEX Rust Core (#12)

Summary

Wire apl-core (APL policy evaluator) and cedarling (identity resolution + Cedar PDP) as built-in plugins in the Rust core. These become native Rust HookHandler implementations running at full speed inside the CPEX executor.

Motivation

APL and cedarling are already implemented in Rust with PyO3 bindings. Running them as native CPEX plugins in the Rust core eliminates the Python→Rust→Python round-trip that currently happens when the Python PluginManager calls into the Rust APL evaluator. Identity resolution, policy evaluation, and token delegation all run in-process at native speed.

Scope

APL Plugin

  • Implements HookHandler<CmfHook> — registers for cmf.tool_pre_invoke, cmf.tool_post_invoke
  • Builds AttributeBag from CMF extensions (subject, delegation, session, meta, args/result)
  • Evaluates compiled APL policy — pre-invoke rules, result transforms, post-invoke rules
  • Returns PluginResult with modified payload (redacted/masked fields) and modified extensions (taint labels)
  • Loads policy from YAML path in plugin config

Cedarling Identity Plugin

  • Implements HookHandler<IdentityResolve> — registers for identity_resolve
  • Multi-issuer JWT validation via cedarling's token validation
  • Decodes JWT into SubjectExtension (roles, permissions, teams, claims)
  • Returns resolved identity as extension modification

Token Delegation Plugin

  • Implements HookHandler<TokenDelegate> — registers for token_delegate
  • RFC 8693 token exchange with scope narrowing
  • Delegation chain construction via DelegationExtension.with_new_hop()
  • Audience mapping from plugin config

Acceptance Criteria

  • APL policy YAML from the HR demo evaluates correctly as a native Rust plugin
  • Identity resolution from JWT produces the same SubjectExtension as the Python version
  • Token delegation produces scoped tokens with monotonic scope narrowing
  • End-to-end: identity → policy → delegation → tool call → result transforms → taint — all in Rust
  • Performance: sub-millisecond for APL evaluation, comparable to direct apl-core calls

Dependencies

Activity

  1. added this to the 0.2.0 milestone on Apr 17, 2026
  2. added
    enhancement
    on Apr 17, 2026
  3. moved this from Backlog to In progress in CPEXon Jun 5, 2026
  4. added theissue type on Jun 5, 2026
  5. linked a pull request that will close this issuefeat: initial APL Rust implementation. #60on Jun 5, 2026
  6. moved this from In progress to Done in CPEXon Jun 5, 2026
  7. closed this as completedby moving to Done in CPEXon Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions