feat: Add NTI Guardrail Middleware for post-quantum agent security - #7817
abisheakp197 wants to merge 1 commit into
Conversation
|
Thanks for the pull request. First-time contributors need an associated open issue before we can review a PR.
See the contributing guide. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b10c97d. Configure here.
| req["pqc_public_key"] = self.pqc_key.public_key_hex() | ||
|
|
||
| decision = json.loads(self.engine.evaluate(json.dumps(req))) | ||
| return decision.get("decision") == "Allow" |
There was a problem hiding this comment.
Guardrail module is not packaged
High Severity
NTIGuardrailMiddleware was added under repository-root crewai/security/ instead of the installable package at lib/crewai/src/crewai/security/. It is never exported or imported, so the guardrail cannot be used after installing crewai.
Reviewed by Cursor Bugbot for commit b10c97d. Configure here.
| def verify_tool_execution(self, tool_name: str, tool_input: dict) -> bool: | ||
| import json | ||
| req = { | ||
| "id": f"req-{abs(hash(str(tool_input)))}", |
There was a problem hiding this comment.
Request IDs are not unique
Medium Severity
Request id values are derived from hash(str(tool_input)). Python salts string hashes per process, and the same tool_input always produces the same id, so identifiers are neither stable across runs nor unique per tool call.
Reviewed by Cursor Bugbot for commit b10c97d. Configure here.


Description
#7818
This PR introduces NTI (Neutral Trust Infrastructure) as an optional security guardrail for CrewAI agents.
As AI agents begin executing real-world actions, verifying their identity and policy bounds in real-time becomes critical.
This integration adds
NTIGuardrailMiddlewarewhich uses theube-foundationPython SDK to enforce:TrustEngine.evaluate)Installation