v1.0.0 Stable

Stop Giving Agents
"God Mode"

Security Middleware for AI Agents. Zero Trust Architecture. Prevent prompt injection, billing disasters, and unauthorized access with one line of code.

Quick Start
# Install the middleware SDK
$ npm install molt-guard
// SYSTEM_LOGIC_FLOW

Zero Trust by Design

🤖 AI Agent
🛡️ Molt Guard (Interceptor)
📦 Guard SDK
🧠 Guard Server
policy
engine
🔐 RBAC
📝 Moderation
💰 Budget
DENIED
🔑 Token Vendor
💳 Stripe
☁️ AWS
1. Call Tool
2. Intercept
3. Evaluate
4. Vend JIT Token
5. Execute
// CAPABILITIES

What It Does

🔐
JIT Token Vending
Static keys are dead. We issue ephemeral credentials for AWS and Stripe that live for 5 minutes and self-destruct.
💰
Budget Controls
Stop infinite loops from draining your wallet. Hard caps on API spend per hour, day, or request.
📝
Content Moderation
Automatically detect PII, offensive language, or negative sentiment before it hits the API.
🧠
Intent Analysis
We analyze the intent of the agent's request. If it tries to delete data when it should only read, we block it.
📜
Audit Logging
Full visibility. "Agent X accessed Stripe because 'User asked for refund'." Complete decision trail.
🔌
Universal Wrapper
Wrap any tool or function with guard.protect(). Works with any TS/JS agent framework.

// REAL_TIME_AUDIT

The Guard Server evaluates every request against your policies in milliseconds.

molt-guard-server — v1.0.0
INFO [GuardServer] Policy Engine Active.
Incoming Request: Stripe.charge({amount: 5000})
Intent: "Refund customer order #992"
User Role: SUPPORT_L1
⚠️ VIOLATION DETECTED: Refund limit exceeded ($50 max)
Decision:
⛔ DENY
Token Vending Aborted.

// INTEGRATION_CODE

import { guard, Protected } from 'molt-guard';

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// 1. INITIALIZE THE GUARD
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
await guard.init({
  policy: {
    budget: { dailyLimit: 500 },
    moderation: { detectPii: true }
  }
});

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// 2. PROTECT LEGACY TOOLS (Wrapper Method)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
const stripeApi = {
  charge: async (params) => { /* ... */ },
};

// Wrap with security layer - Agent never sees raw API keys
const securedStripe = guard.protect(stripeApi, 'financial_policy');

await securedStripe.charge({ amount: 1000 }); 
// -> Intercepted -> Checked -> JIT Token Vended -> Executed


// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// 3. PROTECT CLASSES (Decorator Method)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
class PaymentService {
  
  @Protected('financial_policy')
  async processPayment(amount: number): Promise<void> {
    // Implementation
  }
}
// ECOSYSTEM

Works With Everything

TypeScript
🟢 Node.js
🦜 LangChain.js
💳 Stripe
☁️ AWS SDK
💎 Gemini
🤖 OpenAI