Skip to content
koushikark22Public

About

Consent integrity firewall for Slack AI agents — one approval, one exact action, one time.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Consentry

Cryptographically Bound Authorization for AI Agents in Slack

Consentry is a consent-integrity and authorization layer for AI agents operating through Slack.

Traditional approval systems record that a user clicked Approve. Consentry goes further by cryptographically binding approval to the exact action contract. Before execution, the requested action is reconstructed, canonicalized, hashed, and compared against the approved contract. If anything has changed, execution is denied.

This allows organizations to safely authorize high-impact AI agent actions without relying on transferable approval clicks.


Why Consentry?

As AI agents become capable of performing privileged actions, organizations increasingly rely on human approval before execution.

However, a simple approval is not sufficient.

Between approval and execution, an agent, integration, compromised middleware, or software defect could alter:

  • Destination
  • Parameters
  • Content
  • Resource
  • Tool
  • Execution context

Traditional approval systems generally validate only that an approval exists.

They do not verify that the executed action is identical to the one that was approved.

Consentry addresses this problem by converting approval into an immutable authorization contract.


Core Principle

One approval. One exact action. One time.

Each approval is bound to:

  • Workspace
  • Requester
  • Approver
  • Agent identity
  • Tool
  • Action
  • Resource
  • Destination
  • Parameters
  • Content digest
  • Policy version
  • Expiration time
  • Unique token identifier

Execution is permitted only when the reconstructed request exactly matches the approved contract.


Features

  • Slack-native approval workflow
  • Deterministic canonical JSON serialization (RFC 8785)
  • SHA-256 payload fingerprinting
  • Signed consent tokens
  • One-time authorization tokens
  • Token expiration
  • Token revocation
  • Replay protection
  • Payload substitution detection
  • Fail-closed authorization
  • Tamper-evident audit logging
  • SQLite persistence
  • FastAPI API
  • Public MCP server
  • Slack Identity Authentication
  • Security-focused dashboard

Architecture

AI Agent
    │
    ▼
Consentry Request
    │
    ▼
Canonical JSON
    │
    ▼
SHA-256 Fingerprint
    │
    ▼
Slack Approval Card
    │
Human Approval
    │
    ▼
Signed Consent Token
    │
    ▼
Execution Verification
    │
    ├── Exact Match
    │      │
    │      ▼
    │   Execute
    │
    └── Any Difference
           │
           ▼
          Deny

Security Model

Before executing any protected action, Consentry verifies:

  • Token signature
  • Token expiration
  • Revocation status
  • One-time use
  • Canonical payload hash
  • Workspace binding
  • Requester binding
  • Agent identity
  • Tool
  • Action
  • Resource
  • Destination
  • Parameters
  • Content digest
  • Policy version

Execution is denied if any verification fails.


Security Guarantees

Consentry provides:

  • Approval-to-action binding
  • Deterministic payload verification
  • Cryptographically signed authorization
  • Replay prevention
  • Revocation enforcement
  • Expiration enforcement
  • Tamper-evident auditing
  • Fail-closed authorization

Trust Boundaries

Consentry assumes the following components are trusted:

  • Slack identity
  • Consentry service
  • Canonical serialization implementation
  • Signing keys
  • Database
  • Final execution adapter

Consentry protects only actions executed through its authorization boundary.


Limitations

Consentry does not protect against:

  • Human approval of malicious requests
  • Compromise of Consentry secrets
  • Integrations that bypass Consentry
  • Side effects executed outside the protected adapter
  • Omitted fields that are intentionally excluded from the approval contract

The audit log is tamper-evident rather than immutable.


Project Structure

app/
    blocks.py
    canonical.py
    config.py
    db.py
    main.py
    mcp_server.py
    public_mcp.py
    service.py
    slack_app.py

tests/

docs/

requirements.txt

README.md

Installation

python -m venv .venv

.\.venv\Scripts\Activate.ps1

pip install -r requirements.txt

Configuration

Copy the example configuration:

Copy-Item .env.example .env

Populate the required Slack credentials and application secrets.


Running

Start the local dashboard:

python -m uvicorn app.main:app --reload --port 8000

Start the Slack Socket Mode worker:

python -m app.slack_app

Start the public MCP endpoint:

python -m uvicorn app.public_mcp:app --host 127.0.0.1 --port 8001

Expose the MCP endpoint through HTTPS (for example using ngrok) and configure the Slack app to use the public /mcp endpoint.


Slack Integration

Consentry integrates with Slack using:

  • Slack Block Kit
  • Socket Mode
  • Slack Identity Authentication
  • MCP (Model Context Protocol)

Approval requests are presented as native Slack approval cards.


Testing

Run the automated tests:

pytest

Run the security proof script:

python security_proof.py

License

This project is provided for demonstration and research purposes. Review and adapt the implementation before deploying it in production environments.

About

Consent integrity firewall for Slack AI agents — one approval, one exact action, one time.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages