Skip to content

feat(tools): add Creduent zero-trust agent verification tool (Closes #6773) - #6780

Open
cyberfascinate wants to merge 9 commits into
crewAIInc:mainfrom
cyberfascinate:feat/creduent-verification-tool
Open

feat(tools): add Creduent zero-trust agent verification tool (Closes #6773)#6780
cyberfascinate wants to merge 9 commits into
crewAIInc:mainfrom
cyberfascinate:feat/creduent-verification-tool

Conversation

@cyberfascinate

Copy link
Copy Markdown

Summary

Adds CreduentVerificationTool to crewai-tools to enable local zero-trust verification of external agent identities and attestations before task delegation.

Proposed Changes

  • Added CreduentVerificationTool under lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/
  • Registered tool in crewai_tools.tools exports
  • Added unit test suite in lib/crewai-tools/tests/tools/test_creduent_verification_tool.py

Protocol Verification

Performs local Ed25519 signature verification and canonical JCS RFC 8785 attestation validation on agent URIs (agent://<namespace>/<name>) in under 5ms.

Closes #6773

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds CreduentVerificationTool with schema validation, lazy dependency loading, agent URI verification, strict-mode error handling, package exports, documentation, dependency metadata, and unit tests.

Changes

Creduent verification integration

Layer / File(s) Summary
Verification tool implementation
lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py
Adds the input schema, tool metadata, lazy Creduent loading, verification execution, success responses, and strict or non-strict error handling.
Package integration and documentation
lib/crewai-tools/pyproject.toml, lib/crewai-tools/src/crewai_tools/tools/__init__.py, lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/__init__.py, lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/README.md
Adds the optional dependency, exports the tool, and documents installation, usage, and verification protocol details.
Verification behavior tests
lib/crewai-tools/tests/tools/test_creduent_verification_tool.py
Tests schema validation, default attributes, successful verification, strict-mode failures, unexpected verifier exceptions, and missing-package handling.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant CreduentVerificationTool
  participant CreduentVerify
  Caller->>CreduentVerificationTool: provide agent_uri
  CreduentVerificationTool->>CreduentVerify: verify agent_uri
  CreduentVerify-->>CreduentVerificationTool: verification result or error
  CreduentVerificationTool-->>Caller: return success or failure
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the new Creduent zero-trust agent verification tool.
Description check ✅ Passed The description accurately summarizes the tool, exports, tests, and verification protocol.
Linked Issues check ✅ Passed The changes add the requested Creduent tool, local Ed25519 and JCS verification, exports, dependency metadata, and tests for issue #6773.
Out of Scope Changes check ✅ Passed All changes support the requested tool integration, including implementation, documentation, exports, dependency metadata, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
lib/crewai-tools/tests/tools/test_creduent_verification_tool.py (2)

37-50: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Strengthen the failure-message assertion to catch message corruption.

This test only checks "Invalid signature" in str(exc_info.value). Because of the double-wrapping bug flagged in creduent_verification_tool.py (Lines 58-75), the actual raised message becomes "Verification failure for {agent_uri}: Verification FAILED for {agent_uri}: Invalid signature" instead of the intended single-wrapped message, yet this test still passes. Assert the exact expected message (once the tool fix is applied) to catch this class of regression.

✅ Proposed stronger assertion
-    assert "Invalid signature" in str(exc_info.value)
+    assert str(exc_info.value) == (
+        "Verification FAILED for agent://untrusted.dev/hacker: Invalid signature"
+    )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-tools/tests/tools/test_creduent_verification_tool.py` around lines
37 - 50, Update test_failed_verification_strict to assert the complete exact
ValueError message, including the agent URI and the intended single
“Verification FAILED” wrapper around “Invalid signature,” rather than checking
substring inclusion. Keep the strict-mode setup and exception capture unchanged
so the test detects double-wrapped or otherwise corrupted messages.

1-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a test for the missing-package fallback path.

No test covers the ImportError branch in _run (Lines 49-55 of creduent_verification_tool.py) where creduent is not installed and the tool returns an install-hint message. Add a test that simulates the missing import (e.g., patching builtins.__import__ or using sys.modules manipulation) to confirm the fallback message is returned instead of raising.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-tools/tests/tools/test_creduent_verification_tool.py` around lines
1 - 51, Add a test covering the ImportError fallback in
CreduentVerificationTool._run by simulating an unavailable creduent package,
then invoke the tool and assert it returns the expected installation-hint
message without raising. Preserve the existing verification tests and use import
mocking or sys.modules manipulation to trigger the missing-package branch.

Source: Path instructions

lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py (1)

9-19: 🚀 Performance & Scalability | 🔵 Trivial

Consider validating the agent://<namespace>/<name> format at the schema level.

agent_uri accepts any string with no pattern constraint, even though the tool's contract is specifically agent://<namespace>/<name> per the description and README. Adding a pattern to the Field would reject malformed URIs before the lazy import and network-free crypto check, giving faster and clearer feedback to the calling agent.

♻️ Optional pattern validation
     agent_uri: str = Field(
         ...,
         description="Target agent URI to verify, formatted as agent://<namespace>/<name>",
+        pattern=r"^agent://[^/]+/[^/]+$",
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py`
around lines 9 - 19, Add schema-level pattern validation to the agent_uri field
in CreduentVerificationSchema so only values matching the documented
agent://<namespace>/<name> format are accepted. Keep the existing field
description and ensure malformed URIs are rejected before tool execution.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py`:
- Around line 58-75: Separate the verify(agent_uri) call from the invalid-result
handling in the surrounding method so exceptions raised by verify are handled by
the generic error path, while the deliberate strict-mode ValueError for
result.valid == False bypasses it. Preserve the existing warning and exact
“Verification FAILED…” message for invalid results, and keep unexpected
exception logging and chaining unchanged.
- Around line 22-55: Wire the optional creduent dependency through
CreduentVerificationTool by declaring its package dependency, adding a
corresponding pyproject extra, and referencing that extra in the tool
documentation. Update test_creduent_verification_tool.py to provide a test-only
importable boundary or patch a local abstraction instead of requiring the
upstream creduent package to exist.

---

Nitpick comments:
In
`@lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py`:
- Around line 9-19: Add schema-level pattern validation to the agent_uri field
in CreduentVerificationSchema so only values matching the documented
agent://<namespace>/<name> format are accepted. Keep the existing field
description and ensure malformed URIs are rejected before tool execution.

In `@lib/crewai-tools/tests/tools/test_creduent_verification_tool.py`:
- Around line 37-50: Update test_failed_verification_strict to assert the
complete exact ValueError message, including the agent URI and the intended
single “Verification FAILED” wrapper around “Invalid signature,” rather than
checking substring inclusion. Keep the strict-mode setup and exception capture
unchanged so the test detects double-wrapped or otherwise corrupted messages.
- Around line 1-51: Add a test covering the ImportError fallback in
CreduentVerificationTool._run by simulating an unavailable creduent package,
then invoke the tool and assert it returns the expected installation-hint
message without raising. Preserve the existing verification tests and use import
mocking or sys.modules manipulation to trigger the missing-package branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b36547a4-835b-419b-a4d7-ed1c9b6e0598

📥 Commits

Reviewing files that changed from the base of the PR and between c8f441c and 495221d.

📒 Files selected for processing (5)
  • lib/crewai-tools/src/crewai_tools/tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/README.md
  • lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py
  • lib/crewai-tools/tests/tools/test_creduent_verification_tool.py

@Correctover

Copy link
Copy Markdown

Great work on this @cyberfascinate — zero-trust agent identity verification is a real gap in multi-agent orchestration, and integrating it natively into crewai-tools is the right move.

A few observations from our work on CCS (Common Component Standard for Agent Runtime Verification) that might be worth considering:

Identity is necessary but not sufficient

Creduent covers the Identity dimension well — Ed25519 signatures + JCS canonical attestation in <5ms is solid. But identity alone does not guarantee safe delegation. A verified agent can still:

  • Return outputs that exceed schema contracts (Structure violation)
  • Consume unbounded tokens/time (Cost/Latency violation)
  • Execute paths outside its declared capability (Integrity violation)

This is exactly why we designed CCS as a 6-dimensional runtime verification framework: Structure, Schema, Latency, Cost, Identity, Integrity. Identity is one of six pillars, not the whole story.

Practical suggestion

The Creduent tool here could serve as the Identity layer within a broader verification pipeline. For example, before delegating a task:

  1. Identity — Verify agent URI via Creduent (this PR) ✅
  2. Schema — Validate that the agent's declared tool schemas match expected contracts
  3. Latency/Cost — Enforce timeout and token budgets on the delegated call
  4. Integrity — Verify the agent's response conforms to expected output structure

Our reference implementation ccs-verifier (PyPI, open-source) benchmarks at P50 ≈ 7.5μs / P99 ≈ 21μs for the full 6-dimension check, which is fast enough to sit on every inter-agent call without noticeable overhead.

On standardization

We've submitted an IETF Internet-Draft for CCS to keep it vendor-neutral and open. Creduent's agent URI scheme (agent://<namespace>/<name>) maps cleanly to the CCS Identity dimension — they're complementary, not competing.

Happy to collaborate on a conformance test suite or a joint reference implementation if the crewAI maintainers are interested. Either way, glad to see identity verification getting attention in the ecosystem.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py (1)

50-56: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Fail closed when creduent is unavailable in strict mode.

A missing verifier means the target identity cannot be verified. This branch returns a normal string even when strict=True. A caller that relies on strict-mode exceptions can continue delegation without verification.

Raise ValueError from this branch when self.strict is enabled.

Proposed fix
-        except ImportError:
-            return (
+        except ImportError as err:
+            error_msg = (
                 "Error: creduent package is not installed. "
                 "Install it using: pip install creduent"
             )
+            if self.strict:
+                raise ValueError(error_msg) from err
+            return error_msg
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py`
around lines 50 - 56, Update the ImportError branch in the verification method
to raise ValueError with the existing missing-package message when self.strict
is enabled, while preserving the current string return behavior when strict mode
is disabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py`:
- Around line 50-56: Update the ImportError branch in the verification method to
raise ValueError with the existing missing-package message when self.strict is
enabled, while preserving the current string return behavior when strict mode is
disabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e383588b-b51b-4ef8-83f5-ae4c6a60c014

📥 Commits

Reviewing files that changed from the base of the PR and between c90a727 and 49d8e7f.

📒 Files selected for processing (3)
  • lib/crewai-tools/pyproject.toml
  • lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py
  • lib/crewai-tools/tests/tools/test_creduent_verification_tool.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
lib/crewai-tools/tests/tools/test_creduent_verification_tool.py (1)

71-73: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the public run entry point in these tests.

Both tests call CreduentVerificationTool._run directly and bypass BaseTool.run. The missing-package test should call tool.run(...) instead.

Also applies to: 82-83

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-tools/tests/tools/test_creduent_verification_tool.py` around lines
71 - 73, Update both Creduent verification tests to invoke the public tool.run
entry point instead of calling tool._run directly, including the missing-package
case around CreduentVerificationTool. Preserve the existing arguments and
assertions while ensuring execution goes through BaseTool.run.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@lib/crewai-tools/tests/tools/test_creduent_verification_tool.py`:
- Around line 71-73: Update both Creduent verification tests to invoke the
public tool.run entry point instead of calling tool._run directly, including the
missing-package case around CreduentVerificationTool. Preserve the existing
arguments and assertions while ensuring execution goes through BaseTool.run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 484ffed8-14f5-4d2c-a244-8592e1c89fdf

📥 Commits

Reviewing files that changed from the base of the PR and between 49d8e7f and 5662f12.

📒 Files selected for processing (2)
  • lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py
  • lib/crewai-tools/tests/tools/test_creduent_verification_tool.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/crewai-tools/src/crewai_tools/tools/creduent_verification_tool/creduent_verification_tool.py

@cyberfascinate

Copy link
Copy Markdown
Author

Thanks @Correctover for the thoughtful feedback and for highlighting the CCS framework.

That distinction is key: identity verification provides the cryptographic root of trust for an agent's origin and keys, while runtime governance validates execution bounds like schema contracts, rate limits, and output structure.

The mapping between Creduent's agent:// URI attestation schema and CCS's identity dimension makes a lot of sense. Having identity sit cleanly as the cryptographic layer within a multi-dimensional verification pipeline is the right architecture for zero-trust agent delegation.

Would be happy to explore a joint reference implementation or conformance integration once this PR lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add Creduent zero-trust agent identity verification tool

2 participants