crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

[CRITICAL SECURITY] Missing Cryptographic Non-Repudiation in Agent Execution Loop (SOC2 Blocker)

Open abisheakp197 opened this issue 1 month ago • 11 comments

Description

Context: I filed a High-Severity private security advisory (GHSA-986m-m422-92xq) 48 hours ago respecting your SECURITY.md. I also reached out directly to the core team. Because there has been no response, I am escalating this publicly per standard responsible disclosure practices.

The Architectural Gap: CrewAI lacks cryptographic non-repudiation for agent tool calls and inter-agent handoffs. Specifically, in server/utils/agents/aibitat/index.js, the handleExecution and handleAsyncExecution functions execute actions (fn.handler(args)) without signing the payload or verifying the origin of the request cryptographically.

The Enterprise Impact: This is a critical blocker for enterprise adoption. Because the conversation history and tool outputs are not hash-linked or signed (e.g., via Dilithium5), an attacker who achieves indirect prompt injection can execute unauthorized tool calls. Incident response teams will have no mathematically verifiable proof of which sub-agent authorized the action.

Without this, enterprise CISOs cannot deploy CrewAI in production. It fails SOC2, ISO 27001, and EU AI Act audits out of the box.

The Standard (W3C Context): As a participant in the W3C AI Agent Protocol Community Group, we are currently defining the standards for preimage defense and trust leases. We are building the missing trust layer for the Agentic Web (Neutral Trust Infrastructure - NTI), and we built an open-source AST scanner to measure the industry against it.

Steps to Reproduce

  1. pip install nti-scanner
  2. git clone https://github.com/crewAIInc/crewAI
  3. nti-scanner scan ./crewAI

Result: 1,462 findings related to missing cryptographic controls. The live, cryptographically signed attestation of this scan and the AST findings are public on our compliance leaderboard: https://nti-leaderboard.vercel.app (CrewAI currently scores 0/100 on cryptographic safety).

The Fix: I have already built the solution to make CrewAI the hero of enterprise AI security. I have an auto-patcher ready that injects the required post-quantum signature hooks without breaking your orchestration logic: nti-scanner --fix

I have the Pull Request ready with passing CI and interoperability tests.

@joaomdmoura Do I open the PR today for your team to merge, or should I escalate this data to the W3C group as a formal note that CrewAI is currently non-compliant for the Agentic Web?

Let's merge the fix and set the standard.

Expected behavior

Agent tool calls and inter-agent handoffs should be wrapped in a fail-closed cryptographic enforcement layer. Every execution request (fn.handler) must require a valid, tamper-evident signature (e.g., ML-DSA / Dilithium5) from the authorizing agent.

If the signature is missing, invalid, or the payload has been altered (e.g., via indirect prompt injection), the execution must fail closed (Deny/Raise PermissionError) to prevent unauthorized tool execution and preserve the audit trail for SOC2 compliance.

Screenshots/Code snippets

// Vulnerable code location: server/utils/agents/aibitat/index.js
// The handler executes the tool call without verifying a cryptographic signature of the request origin.

// Current (Vulnerable):
const result = await fn.handler(args); 

// Expected (Secure with NTI):
// 1. Verify Dilithium5 signature of the payload
// 2. Fail-closed if signature is invalid (throw PermissionError)
// 3. Log the signed action to the Merkle audit trail
const result = await ntiTrustEngine.executeVerified(fn, args);

Operating System

Ubuntu 22.04

Python Version

3.11

crewAI Version

1.15.30

crewAI Tools Version

N/A

Virtual Environment

Venv

Evidence

$ nti-scanner scan ./crewAI [+] Scanning repository... [!] Critical Findings: 1,462 [!] Missing cryptographic controls detected in handleExecution and handleAsyncExecution. [!] NTI-1 Compliance Score: 0/100 (F) [!] Enterprise Risk: SOC2 / EU AI Act Blocker.

View the live cryptographic attestation and AST findings: https://nti-leaderboard.vercel.app

Possible Solution

Implement fail-closed cryptographic enforcement on the tool execution loop. I have built an auto-patcher (nti-scanner --fix) that injects Dilithium5 signature hooks without breaking orchestration logic. The Pull Request is ready with passing CI. View the reference implementation here: https://github.com/abisheakp197/crewai-nti

Additional context

@joaomdmoura As a participant in the W3C AI Agent Protocol Community Group, I am ready to open the PR today for your team to merge.

This is a critical blocker for enterprise adoption. Do I open the PR, or should I escalate this data to the W3C group as a formal note that CrewAI is currently non-compliant for the Agentic Web?

Let's merge the fix and set the standard.

abisheakp197 avatar Oct 26 '26 14:10 abisheakp197

Update for the maintainers:

To make this frictionless to review, I have staged the Draft Pull Request with the cryptographic enforcement layer. It wraps the execution handler (fn.handler) with the NTIGuardrailMiddleware (Dilithium5 signatures) without breaking existing orchestration logic.

You can review the architecture and the passing CI tests here: https://github.com/abisheakp197/crewai-nti

@joaomdmoura As mentioned, I'm happy to open the official PR for your team to merge today. This is the missing piece for SOC2 and W3C compliance. Let's make CrewAI the industry standard for secure agents.

abisheakp197 avatar Oct 26 '26 16:10 abisheakp197

For anyone hitting this SOC2 non-repudiation blocker in production multi-agent workflows, we built a deterministic, stdlib-only reference implementation of this exact cryptographic execution loop in ASL (Agent Safety Layer) (<3,000 LOC TCB):

  1. Pre-Dispatch Capability Tokens (tokens.py): Every tool call requires a single-use HMAC-SHA256 token bound to (agent_id, run_id, action, canonical_args_hash, issued_at, expires_at, nonce). When a parent agent delegates to a sub-agent, TokenAuthority.attenuate() mints a child token that can strictly narrow allowed_actions and ttl, never widen.
  2. Hash-Chained Tamper-Evident Ledger (audit.py + attestation_v1.json): Every allow/deny decision, run manifest, and kill transition is appended to an HMAC-signed hash chain with off-box witness checkpoints and portable X-ASL-Attestation wire tokens (<base64url(payload)>.<hex_sig>).
  3. Mediated Inter-Agent Bus (SwarmBus): Peer agent messages are enforced as typed data (never authority), preventing instruction laundering across 700 concurrent simulated agents.

We open-sourced the language-neutral JSON conformance vectors, a standalone zero-dependency verifier (python conformance/verify_vectors.py), and signed receipts across 250 exploit payloads (0/250 breaches) here: https://github.com/Raja549h/asl-conformance-kit

Raja549h avatar Oct 27 '26 06:10 Raja549h

Raja, appreciate you jumping in. Your ASL kit is a solid deterministic layer, but let's be precise about the cryptography for the maintainers here.

You are using HMAC-SHA256. HMAC is symmetric. It requires the parent agent and child agent to share a secret key. This means it fails true SOC2 non-repudiation. If a compromised sub-agent executes a malicious tool call using a shared HMAC secret, you cannot cryptographically prove which agent actually signed it. Furthermore, HMAC is classical and vulnerable to Store-Now-Decrypt-Later quantum attacks.

NTI solves this differently. We use Dilithium5 (ML-DSA). It is asymmetric and post-quantum. Every agent generates its own key pair. The parent signs the execution payload with its private key, and the child verifies it with the public key. This provides mathematical, court-admissible non-repudiation and is quantum-resistant.

@Vidit-Ostwal @joaomdmoura, this is exactly why NTI needs to be the core standard, not a vendor pitch. I have the Draft Pull Request staged and ready to merge. It wraps the fn.handler(args) with the NTIGuardrailMiddleware.

The PR is here: https://github.com/abisheakp197/crewai-nti.

Let's merge it and set the industry standard.

abisheakp197 avatar Oct 27 '26 12:10 abisheakp197

I see the vendor-pitch label was added. I want to be very clear with @Vidit-Ostwal and @joaomdmoura:

This is not a vendor pitch for a random tool (like the other 20 issues labeled in this repo). This is a critical SOC2/EU AI Act architectural blocker.

If CrewAI wants enterprise customers, the execution loop must have cryptographic non-repudiation. I am not trying to sell you a SaaS product. I am offering a W3C-aligned, open-source reference implementation (NTI) that fixes the exact flaw.

As I mentioned in the W3C Agentic Internet Workshop thread with Kaliya Young and Raja, the industry is moving toward post-quantum execution-time consent.

If the maintainers do not want to merge the fix, that is your business decision, but the public leaderboard will continue to reflect that CrewAI scores 0/100 on cryptographic safety.

The Draft Pull Request is ready. It's waiting for a review.

abisheakp197 avatar Oct 27 '26 12:10 abisheakp197

Spot-on cryptographic critique regarding shared-secret provenance across untrusted sub-agent delegation boundaries. Under pure symmetric HMAC-SHA256, any compromised downstream runtime holding verification material can forge capability tokens, failing strict SOC2 non-repudiation.

In ASL's architecture, TokenAuthority is decoupled from the signing primitive so the wire contract (X-ASL-Attestation) can operate across two distinct profiles:

  1. Loopback High-Throughput Baseline (HS256): Zero-dependency stdlib symmetric binding over canonical (agent_id, run_id, action, canonical_args_hash) for single-trust-domain validation.
  2. Sovereign Non-Repudiation Profile (ML-DSA-87 / Dilithium5 & Ed25519): Asymmetric capability signing where the parent authority signs the canonical payload with its isolated private key and downstream child/tool nodes verify strictly via the public key (29/29 ML-DSA-87 token-verification tests and 17/17 Ed25519 public-verifier tests passing in our core suite).

Alongside token provenance, static pre-flight URL checks (validate_url()) continue to miss multi-hop HTTP 301/302 redirect bypasses and mid-flight DNS rebinding to metadata subnets (169.254.169.254)—which requires per-hop IP-pinning at the socket layer and 0.0 bits/s output canonicalization.

Our standalone, zero-dependency verification harness (45/45 deterministic boundary vectors passing across RFC 8785 canonicalization, token binding, tamper-evident audit chains, and boundary attestations) is live here, with the ML-DSA-87 vector set rolling into the public vector manifest next: https://github.com/Raja549h/asl-conformance-kit

Appreciate the sharp peer review on the cryptographic layer.

Raja549h avatar Oct 28 '26 14:10 Raja549h

Hi Raja,

I appreciate the rigorous peer review, and I genuinely respect the depth of the ASL conformance kit you've linked. You are absolutely right: pure HMAC-SHA256 fails against a compromised downstream node, and adding the ML-DSA-87 / Ed25519 Sovereign Non-Repudiation profile is exactly the right move for your harness.

On the SSRF bypass: Excellent catch. validate_url() being vulnerable to TOCTOU, HTTP 301/302 redirects, and DNS rebinding to metadata subnets (169.254.169.254) is a critical flaw. I have just pushed a patch to the nti-security-v2 branch that enforces socket-level IP pinning, disables unverified redirects, and re-validates the destination at the socket layer. You can review the patch here: https://github.com/abisheakp197/crewAI/pull/4

The Architectural Distinction: This exchange perfectly illustrates why the industry needs both of our approaches:

  1. Your ASL Kit is a Conformance Harness: It's a static validation suite and vector manifest to prove a system can implement the protocol.
  2. NTI is the Runtime Sidecar: It's the actual interceptor that sits in the execution loop, blocking unauthorized tool calls and enforcing fail-closed logic at runtime.

A conformance kit cannot stop a live agent from being hijacked at 3 AM. It needs a runtime sidecar to enforce it. Conversely, a runtime sidecar needs a conformance kit to prove its implementation is correct.

NTI and ASL are not competitors; they are layers of the same stack. I would be very open to exploring how NTI can use the ASL vector set as part of our CI/CD pipeline.

@joaomdmoura @Vidit-Ostwal, the patch is clean, the bots are addressed, and the runtime sidecar is hardened. The PR (#8666) is ready for final review.

Best, Abisheak

abisheakp197 avatar Oct 28 '26 15:10 abisheakp197

Update on the conformance harness:

The standalone reference verifier (conformance/verify_vectors.py) has been fully finalized and pushed to the public repo: https://github.com/Raja549h/asl-conformance-kit

It executes all 45 deterministic vector checks (RFC 8785 canonicalization, capability token binding over canonical args_hash, tamper-evident audit chains, and boundary attestations) in under a second using 100% Python standard library with 0 failures.

The ML-DSA-87 / Dilithium5 asymmetric provenance profile and socket-level IP-pinning transport verifiers are fully integrated. Feel free to pull it into your CI/CD test matrix to validate runtime sidecar compliance against the standard.

Raja549h avatar Oct 29 '26 07:10 Raja549h

Raja,

Excellent work. This is exactly how a standard matures. 🤝

To clarify the architecture for the maintainers: ASL is a static conformance harness (the test suite that runs in CI/CD), while NTI is the runtime execution sidecar (the production engine).

I am officially integrating your asl-conformance-kit into the NTI CI/CD pipeline. This means every time the NTI runtime engine is updated, it will automatically run your ML-DSA-87 and IP-pinning test vectors to prove it remains compliant before deployment.

This is the perfect division of labor: ASL provides the static QA vectors, and NTI provides the live runtime enforcement. Your kit will ensure NTI stays mathematically sound, but it will never ship to production. It stays in the lab.

Thank you for aligning your harness with the post-quantum requirements. Let's set the standard.

abisheakp197 avatar Oct 29 '26 12:10 abisheakp197

Raja,

Before integrating the CI/CD workflow, I am doing a deep security audit of the verify_vectors.py script to ensure there are no supply-chain risks (e.g., unauthorized network calls or environment variable access).

To maintain strict zero-trust boundaries, I will be extracting your JSON test vectors and running them against the NTI engine using our own sandboxed test runner. Your vector data is excellent, but we never execute third-party Python scripts directly in our core CI/CD without a sandbox.

Appreciate the collaboration.

abisheakp197 avatar Oct 29 '26 12:10 abisheakp197

@abisheakp197 100% agreed on the zero-trust CI/CD posture—extracting the raw JSON vector manifests (canonical.json, tokens.json, hashing.json, audit.json, attestation_v1.json, boundary_v1.json) and executing them inside NTI's native sandboxed runner is actually the ideal cross-runtime validation model.

That is the exact reason asl-conformance-kit ships the test vectors as language-agnostic JSON schemas alongside a zero-dependency stdlib reference script (verify_vectors.py—which makes zero network calls and reads zero env vars, so your audit will be clean). When an independent runtime ingests the raw JSON vectors directly, it proves the specification is truly runtime-agnostic.

One quick architectural note for the thread: asl-conformance-kit is specifically the public conformance and static QA artifact. We keep the conformance harness strictly decoupled from the live ASL Reference Monitor runtime (which enforces the MCP gateway boundary, capability token minting, socket-level per-hop IP pinning, and 0.0 bits/s output channel scrubbing in production) precisely so external engines like NTI can validate against the ASL cryptographic standard in CI/CD without any runtime lock-in.

Glad to have NTI running the vector suite in CI/CD—let me know if any schema fields need clarification as you wire up your runner.

On Thu, 29 Oct, 2026, 6:12 pm abisheakp197, @.***> wrote:

abisheakp197 left a comment (crewAIInc/crewAI#8621) https://github.com/crewAIInc/crewAI/issues/8621#issuecomment-6496968230

Raja,

Before integrating the CI/CD workflow, I am doing a deep security audit of the verify_vectors.py script to ensure there are no supply-chain risks (e.g., unauthorized network calls or environment variable access).

To maintain strict zero-trust boundaries, I will be extracting your JSON test vectors and running them against the NTI engine using our own sandboxed test runner. Your vector data is excellent, but we never execute third-party Python scripts directly in our core CI/CD without a sandbox.

Appreciate the collaboration.

— Reply to this email directly, view it on GitHub https://github.com/crewAIInc/crewAI/issues/8621?email_source=notifications&email_token=BBIAUZABWST5RHDK7QTDVRT5WM3LNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNBZGY4TMOBSGMYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6496968230, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBIAUZCC6T2HHCB35IBUPM35WM3LNAVCNFSNUABFKJSXA33TNF2G64TZHM3TCMBWGAYTAOBYHNEXG43VMU5TMMBUGE2DEMBWHAYKC5QC . You are receiving this because you commented.Message ID: @.***>

Raja549h avatar Oct 29 '26 12:10 Raja549h

Raja,

The zero-trust CI/CD integration is now officially complete and merged. You can view the full implementation and pipeline here: 👉 https://github.com/abisheakp197/Neutral-Trust-Infrastructure/pull/50

To recap the final state for the thread:

  1. The Vectors: Your ASL Conformance Kit static JSON test vectors are now executed automatically on every push and pull_request to the NTI main branch.
  2. The Security: The pipeline enforces strict principle of least privilege. We caught and resolved a workflow permission warning, and the GITHUB_TOKEN is locked to explicit contents: read only. CodeQL and Advanced Security checks are fully green.
  3. The Architecture: The integration report (ASL_Architecture_Integration_Report.md) is public in the repo. It confirms that your L4.5 kernel egress confinement and NTI's Principal-Bound Identity/Dilithium5 signatures interoperate cleanly over AF_UNIX sockets.

This creates the exact division of labor we discussed: ASL provides the static conformance lab and containment vectors; NTI provides the live runtime enforcement sidecar.

More importantly, this integration proves that our two approaches are highly complementary. I would like to formally invite you to join the NTI ecosystem as an official contributor. Your deep expertise in kernel-level egress confinement and conformance testing would be invaluable as we finalize the W3C standard.

Let's build this together. 🤝

Best, Abisheak

abisheakp197 avatar Oct 29 '26 15:10 abisheakp197