Post-MVP features and enhancements for Ryu Gateway. These are not blockers for launch, but represent the next wave of capabilities that deepen the moat, unlock enterprise deals, and expand the platform.

🔐 Auth & Key Management

Two sides of the same coin: users authenticate to the gateway, and the gateway manages keys for them.

User-Level API Keys

Managed Service Keys

struct KeyVault {
    user_keys: HashMap<UserId, Vec<ApiKey>>,       // keys TO the gateway
    service_keys: HashMap<ServiceId, ServiceKey>,   // keys FOR external services
    rotation_policies: Vec<RotationPolicy>,
    injection_rules: Vec<InjectionRule>,            // which key goes to which MCP/service
}

struct ApiKey {
    id: KeyId,
    scope: KeyScope,                               // models, tools, agents, budget
    expires_at: Option<DateTime>,
    created_by: UserId,
    last_used: Option<DateTime>,
}

struct ServiceKey {
    service: ServiceId,                            // openai, anthropic, github, etc.
    encrypted_key: EncryptedString,
    scoped_to: Vec<Scope>,                         // org/team/project
    auto_rotate: Option<RotationPolicy>,
}

🧠 Context & Memory Layer

Make the gateway context-aware, not just a dumb proxy.