Skip to main content
Connecting Maestro with external services securely.

Secret Management System

What Are Secrets?

Secrets are secrets (API keys, tokens, passwords) that Maestro needs to interact with external services like:
  • Cloud providers (AWS, Azure, GCP)
  • APIs (GitHub, GitLab, OpenAI)
  • Databases (PostgreSQL, MySQL, MongoDB)
  • Third-party services (Stripe, SendGrid, etc.)

Security Model

User-controlled activation:
  • You register secrets once
  • Per-session activation via /secrets command
  • Maestro cannot access without your explicit consent
  • Session-scoped exposure only
Isolation guarantees:
  • Secrets never logged
  • Never shared across sessions
  • Automatic cleanup on session end
  • Encrypted at rest

Managing Secrets

Secret Manager (UI)

Access: Bottom-left menu → “Manage Secrets” Functions:
  • Register new secrets
  • Edit existing secrets
  • Delete secrets
  • View usage history
  • Configure OAuth integrations

Registering Secrets

Manual registration:
  1. Open Secret Manager
  2. Click “Add Secret”
  3. Enter details:
    • Name (e.g., AWS_ACCESS_KEY_ID)
    • Value (the actual secret)
    • Optional: Description, tags
  4. Save (encrypted immediately)
OAuth registration:
  1. Select OAuth provider (GitHub, GitLab, etc.)
  2. Authorize via OAuth flow
  3. Secrets stored automatically
  4. Includes refresh token handling

Activating Secrets

Via /secrets command:
Via natural language:

Using Activated Secrets

In sandbox terminals:
In Maestro’s tool execution:
  • Secrets available to all sandbox commands
  • Automatic injection into environment
  • Tools can use them transparently

Deactivating Secrets

When done with sensitive secrets:

Supported Integrations

Cloud Providers

AWS

Secrets needed:
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION (optional, defaults to us-east-1)
What you can do:

Azure

Secrets needed:
  • AZURE_SUBSCRIPTION_ID
  • AZURE_TENANT_ID
  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
What you can do:

Google Cloud Platform

Secrets needed:
  • GOOGLE_APPLICATION_CREDENTIALS (path to service account JSON)
What you can do:

Version Control

GitHub

OAuth integration (recommended):
  • Link account via Secret Manager
  • Automatic token refresh
  • Access private repositories
  • Create/update PRs
Personal Access Token (alternative):
Capabilities:
  • Clone private repositories
  • Create and update PRs
  • Add review comments
  • Manage issues
  • Trigger workflows

GitLab

OAuth integration:
  • Similar to GitHub
  • Private repository access
  • API operations
Personal Access Token:

Databases

PostgreSQL

MySQL

MongoDB

API Services

OpenAI, Anthropic, etc.

Stripe

SendGrid, Mailgun

OAuth Integration

Supported Providers

  • GitHub
  • GitLab
  • Google
  • Microsoft
  • Custom OAuth 2.0 providers

OAuth Flow

One-time setup:
  1. Secret Manager → Add OAuth Integration
  2. Select provider
  3. Authorize Maestro
  4. Secrets stored with refresh token
Automatic refresh:
  • Tokens refreshed automatically
  • No manual intervention
  • Always valid when activated
Scope management:
  • OAuth scopes shown during authorization
  • Cannot exceed granted scopes
  • Re-authorize to change scopes

OAuth vs Personal Access Tokens

OAuth advantages:
  • Automatic token refresh
  • Granular scope control
  • Revocable via provider
  • Better security
PAT advantages:
  • Simple setup
  • Works in automation
  • No browser required
Recommendation: Use OAuth for interactive work, PATs for automation.

Security Best Practices

Secret Hygiene

DO:
  • Use descriptive names (AWS_PROD, AWS_DEV)
  • Rotate secrets regularly
  • Use least-privilege scopes
  • Deactivate after use
  • Review active secrets regularly
DON’T:
  • Commit secrets to files
  • Share secrets across teams
  • Use overly permissive tokens
  • Leave secrets activated indefinitely

Scope Minimization

Principle: Grant only necessary permissions. Example:

Separation of Environments

Separate secrets per environment:

Audit and Monitoring

Track credential usage:
  • Secret Manager shows last used timestamp
  • Review which sessions used secrets
  • Detect unusual usage patterns

Troubleshooting

Secret Not Working

Check:
  1. Is credential registered in Secret Manager?
  2. Did you activate for this session (/secrets)?
  3. Is credential value correct?
  4. Are scopes sufficient?
  5. Is credential expired?
Verify in sandbox:

OAuth Token Expired

Symptoms:
  • API calls fail with 401
  • “Token expired” errors
Solution:
  • Secret Manager → Refresh OAuth token
  • Or re-authorize via OAuth flow
Automatic refresh: Most OAuth tokens refresh automatically; manual intervention rare.

Permission Denied

Cause: Insufficient OAuth scopes or IAM permissions Solution:
  • For OAuth: Re-authorize with broader scopes
  • For cloud IAM: Grant additional permissions in cloud console
  • For PATs: Generate new token with required scopes

Secret Accidentally Committed

If credential leaked to file:

Integration Patterns

AWS Deployment Example

Database Migration Example

Third-Party API Integration

Advanced OAuth Patterns

Multiple GitHub Accounts

OAuth Secret Sharing

Within organization:
  • Service accounts for shared resources
  • Team-wide OAuth applications
  • Centralized credential management
Security: Use service principals, not personal accounts for shared access.

Next Steps

Secure integration mastered: