Skip to main content

Security

CTP defines security requirements to ensure safe tool execution.

Core Principles

Client Privacy

Client-executed tools MUST NOT transmit input data to external servers

Input Validation

All inputs MUST be validated before processing

Safe Defaults

Default configurations MUST be secure

Fail Secure

Errors MUST NOT expose sensitive information

Privacy Requirements

Client-Mode Tools

Tools with executionMode: 'client' MUST:
  1. Execute entirely in the browser
  2. NOT make network requests with user data
  3. NOT use tracking or analytics on input
  4. NOT persist input data beyond the session

Server-Mode Tools

Tools with executionMode: 'server':
  1. MUST document what data is transmitted
  2. SHOULD use HTTPS for all requests
  3. MUST handle credentials securely
  4. SHOULD implement rate limiting

Input Validation

Required Validation

All tools MUST validate:
  1. Required fields - Presence of required parameters
  2. Type checking - Parameters match expected types
  3. Constraints - Values within allowed ranges
  4. Sanitization - Dangerous content neutralized

Validation Constraints

Output Security

Safe Error Messages

Sanitize Output

When generating HTML or code:

Embedding Security

Content Security Policy

Recommended CSP for embedded tools:

Iframe Sandboxing

Cross-Origin Communication

Rate Limiting

Definition

Runtime Enforcement

Authentication

For tools requiring authentication:

Security Checklist

  • All inputs validated before processing
  • Required parameters enforced
  • Type checking implemented
  • Constraint validation (min/max lengths, ranges)
  • Error messages don’t expose internals
  • Client tools don’t transmit user data
  • Rate limiting configured
  • Authentication enforced where required
  • Output properly escaped/sanitized
  • CSP headers configured for embedding
  • HTTPS used for all external requests
  • Dependencies audited for vulnerabilities