Security & SOC2/ISO Compliance
Relevant source files
The following files were used as context for generating this wiki page:
Speakeasy provides a secure AI control plane that manages Model Context Protocol (MCP) servers, skills, and assistants across organizations. The system implements centralized management, threat detection, and full observability of AI interactions to ensure compliance with enterprise standards. The platform maintains SOC 2 Type II and ISO 27001 certifications to support high-security organizational requirements.
Sources: README.md:14-18, README.md:21-23
Core Security Architecture
The architecture enforces security policies in real-time by inspecting prompts, responses, and agent actions. It prevents data exfiltration by blocking or redacting sensitive information before it leaves the internal environment. The system manages connections to SaaS vendors and internal APIs through a single control layer with integrated policy enforcement.
Data Protection Flows
The following diagram illustrates how the system intercepts and inspects AI traffic to enforce security policies.
The system uses OpenTelemetry as a foundation for tracking usage and tool effectiveness, ensuring every action is logged and searchable.
Sources: README.md:32-35, README.md:38-41, README.md:27-29
SOC 2/ISO Compliance Requirements
To maintain compliance certifications, the project enforces strict coding and architectural standards. This includes mandatory audit logging, rigorous RBAC enforcement, and specialized handling of sensitive customer data.
Audit Logging Standards
Every mutation on a project or organization-scoped resource must generate an audit entry for each affected row. Audit writes are executed within the same database transaction (dbtx) as the mutation to ensure atomicity. If an audit log write fails, the entire request must fail with an oops.CodeUnexpected error.
Sources: REVIEW.md:129-134
Customer Data Confidentiality
Developers must never commit or push customer-identifying information (PII). This includes:
- Customer names and emails.
- Organization and Project IDs.
- Revenue or spend figures.
- External account IDs.
Placeholders like <PROJECT_ID> or <ORG_ID> are used in runbooks, migrations, and test fixtures.
Sources: CLAUDE.md:14-23
Threat Detection and Risk Policies
Speakeasy utilizes several detector families to scan chat messages and tool calls for security risks.
Risk Detector Families
| Source | Description |
|---|---|
gitleaks | Scans for regex-based secrets like API keys and tokens. |
presidio | Identifies PII entities such as emails, SSNs, and credit cards. |
prompt_injection | Uses an LLM judge to detect prompt injection attempts. |
destructive_tool | Flags tool calls that match destructive intent patterns. |
shadow_mcp | Detects calls to MCP servers not on an organization's approved list. |
Sources: server/internal/assistants/managed_assistant_instructions.txt:41-45
Secret Redaction Logic
For gitleaks and presidio sources, the system replaces raw matches with match_redacted, which is an opaque token containing the length and a SHA256-prefix fingerprint. This allows administrators to deduplicate leak counts without exposing the actual secret in the dashboard.
Sources: server/internal/assistants/managed_assistant_instructions.txt:46-51
Access Control & RBAC
The system implements Role-Based Access Control (RBAC) at both the server and dashboard levels.
Server-Side Enforcement
Every mutating handler must call s.authz.Require before performing any database work. For list endpoints, authz.Filter is used to ensure users only see resources they are authorized to access. This prevents Insecure Direct Object Reference (IDOR) vulnerabilities by scoping all queries to specific organization or project IDs.
Sources: REVIEW.md:118-124, cubic.yaml:57-61
Dashboard Gates
The React frontend uses a <RequireScope> component for rendering gates and a useRBAC() hook for imperative checks. These scopes must remain in sync with the server-side definitions.
Sources: REVIEW.md:204-208
MCP Tool Approval Flows
Sensitive MCP tool calls are protected by an interceptor pattern. This provides a security layer that validates admin approval before a tool executes.
Approval Interceptor Flow
Protection Mechanisms
Tools are identified as "protected" based on naming patterns, such as a protected_tool_ prefix. Approval validation can be implemented via:
- Environment Variables: Checking
MCP_TOOL_APPROVALtokens. - API-Based Validation: Calling an external approval service.
- Database-Backed Validation: Checking for time-based approvals in a persistent store.
Sources: examples/functions-approve/readme.md:68-85, examples/functions-approve/src/functions.ts:39-65, examples/functions-approve/src/functions.ts:88-125
Database Security
The database schema and query structure are designed to support multi-tenant isolation and data integrity.
- Mandatory Scoping: All tables must have a non-nullable
project_idforeign key. Every SQLc query must be scoped to this ID. - Soft Deletes: Tables use
deleted_atcolumns and computeddeletedflags instead of rawDELETEstatements. - Transaction Integrity: Audit logs are written within the same transaction as mutations to ensure a verifiable trail of all changes.
Sources: REVIEW.md:154-162, REVIEW.md:178-179, REVIEW.md:131-132
Summary
Security and compliance within the Speakeasy project are achieved through a multi-layered approach involving real-time policy enforcement, automated audit logging, and strict data confidentiality rules. By integrating SOC 2 and ISO 27001 requirements directly into the development workflow—such as mandatory RBAC checks and encrypted secret redaction—the platform provides a defensible and observable environment for enterprise AI agents.