feat(examples): HDP delegation provenance integration#5135
Open
asiridalugoda wants to merge 1 commit intocrewAIInc:mainfrom
Open
feat(examples): HDP delegation provenance integration#5135asiridalugoda wants to merge 1 commit intocrewAIInc:mainfrom
asiridalugoda wants to merge 1 commit intocrewAIInc:mainfrom
Conversation
Adds an end-to-end example showing how to attach cryptographic delegation provenance to a CrewAI crew via the hdp-crewai middleware package (pip install hdp-crewai). The middleware hooks into CrewAI's existing callback system with zero changes to core crew logic, addressing all five design considerations raised in issue crewAIInc#5102: 1. Scope enforcement — authorized_tools list enforced on every agent step; strict mode raises HDPScopeViolationError, default mode logs and records the violation in the token's audit trail. 2. Delegation depth limits — max_hops is enforced per crew execution. 3. Token size / performance — Ed25519 signatures are 64 bytes each; all HDP operations are non-blocking (failures log, never raise). 4. Verification utilities — verify_chain() validates the complete delegation chain offline using only the human's public key. 5. Memory integration — the signed token is persisted to CrewAI's storage directory alongside task outputs for retroactive auditing. Closes crewAIInc#5102
Author
|
@khalidsaidi following up on issue #5102. The companion package referenced in this example Would appreciate a review when you get a chance. Source and release pipeline: https://github.com/Helixar-AI/HDP/tree/main/packages/hdp-crewai |
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
Adds a working integration example for HDP (Human Delegation Provenance) in CrewAI, addressing all five design considerations raised in issue #5102.
No changes to CrewAI core. The middleware hooks into the existing
before_kickoff_callbacks,step_callback,task_callback, andafter_kickoff_callbacksAPIs.Install the companion package:
Spec: https://datatracker.ietf.org/doc/draft-helixar-hdp-agentic-delegation/
Five design considerations addressed
step_callbackinspectsAgentAction.toolagainstauthorized_tools;strict=TrueraisesHDPScopeViolationError, default logs and records the violation in the tokenScopePolicy(max_hops=N)enforced intask_callback; hops beyond the limit are skipped and warnedverify_chain(token, public_key)validates the complete delegation chain offline using only the human's Ed25519 public keyafter_kickoffpersists the signed token JSON to CrewAI's storage directory (db_storage_path()) alongside task outputs for retroactive auditingWhat gets added
An end-to-end example with two agents, two tasks, scope enforcement, and offline chain verification.
How it works
Closes #5102