palaryn 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +716 -0
- package/dist/sdk/typescript/src/client.d.ts +71 -0
- package/dist/sdk/typescript/src/client.d.ts.map +1 -0
- package/dist/sdk/typescript/src/client.js +176 -0
- package/dist/sdk/typescript/src/client.js.map +1 -0
- package/dist/sdk/typescript/src/errors.d.ts +50 -0
- package/dist/sdk/typescript/src/errors.d.ts.map +1 -0
- package/dist/sdk/typescript/src/errors.js +103 -0
- package/dist/sdk/typescript/src/errors.js.map +1 -0
- package/dist/sdk/typescript/src/index.d.ts +4 -0
- package/dist/sdk/typescript/src/index.d.ts.map +1 -0
- package/dist/sdk/typescript/src/index.js +15 -0
- package/dist/sdk/typescript/src/index.js.map +1 -0
- package/dist/sdk/typescript/src/types.d.ts +101 -0
- package/dist/sdk/typescript/src/types.d.ts.map +1 -0
- package/dist/sdk/typescript/src/types.js +6 -0
- package/dist/sdk/typescript/src/types.js.map +1 -0
- package/dist/src/admin/index.d.ts +2 -0
- package/dist/src/admin/index.d.ts.map +1 -0
- package/dist/src/admin/index.js +6 -0
- package/dist/src/admin/index.js.map +1 -0
- package/dist/src/admin/routes.d.ts +5 -0
- package/dist/src/admin/routes.d.ts.map +1 -0
- package/dist/src/admin/routes.js +471 -0
- package/dist/src/admin/routes.js.map +1 -0
- package/dist/src/admin/templates.d.ts +51 -0
- package/dist/src/admin/templates.d.ts.map +1 -0
- package/dist/src/admin/templates.js +500 -0
- package/dist/src/admin/templates.js.map +1 -0
- package/dist/src/anomaly/detector.d.ts +141 -0
- package/dist/src/anomaly/detector.d.ts.map +1 -0
- package/dist/src/anomaly/detector.js +554 -0
- package/dist/src/anomaly/detector.js.map +1 -0
- package/dist/src/anomaly/index.d.ts +2 -0
- package/dist/src/anomaly/index.d.ts.map +1 -0
- package/dist/src/anomaly/index.js +7 -0
- package/dist/src/anomaly/index.js.map +1 -0
- package/dist/src/approval/manager.d.ts +147 -0
- package/dist/src/approval/manager.d.ts.map +1 -0
- package/dist/src/approval/manager.js +511 -0
- package/dist/src/approval/manager.js.map +1 -0
- package/dist/src/approval/webhook.d.ts +36 -0
- package/dist/src/approval/webhook.d.ts.map +1 -0
- package/dist/src/approval/webhook.js +135 -0
- package/dist/src/approval/webhook.js.map +1 -0
- package/dist/src/audit/logger.d.ts +70 -0
- package/dist/src/audit/logger.d.ts.map +1 -0
- package/dist/src/audit/logger.js +440 -0
- package/dist/src/audit/logger.js.map +1 -0
- package/dist/src/auth/index.d.ts +6 -0
- package/dist/src/auth/index.d.ts.map +1 -0
- package/dist/src/auth/index.js +22 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/auth/password.d.ts +3 -0
- package/dist/src/auth/password.d.ts.map +1 -0
- package/dist/src/auth/password.js +25 -0
- package/dist/src/auth/password.js.map +1 -0
- package/dist/src/auth/pkce.d.ts +13 -0
- package/dist/src/auth/pkce.d.ts.map +1 -0
- package/dist/src/auth/pkce.js +58 -0
- package/dist/src/auth/pkce.js.map +1 -0
- package/dist/src/auth/providers.d.ts +28 -0
- package/dist/src/auth/providers.d.ts.map +1 -0
- package/dist/src/auth/providers.js +198 -0
- package/dist/src/auth/providers.js.map +1 -0
- package/dist/src/auth/routes.d.ts +14 -0
- package/dist/src/auth/routes.d.ts.map +1 -0
- package/dist/src/auth/routes.js +431 -0
- package/dist/src/auth/routes.js.map +1 -0
- package/dist/src/auth/session.d.ts +24 -0
- package/dist/src/auth/session.d.ts.map +1 -0
- package/dist/src/auth/session.js +105 -0
- package/dist/src/auth/session.js.map +1 -0
- package/dist/src/billing/index.d.ts +7 -0
- package/dist/src/billing/index.d.ts.map +1 -0
- package/dist/src/billing/index.js +14 -0
- package/dist/src/billing/index.js.map +1 -0
- package/dist/src/billing/plan-enforcer.d.ts +44 -0
- package/dist/src/billing/plan-enforcer.d.ts.map +1 -0
- package/dist/src/billing/plan-enforcer.js +110 -0
- package/dist/src/billing/plan-enforcer.js.map +1 -0
- package/dist/src/billing/routes.d.ts +15 -0
- package/dist/src/billing/routes.d.ts.map +1 -0
- package/dist/src/billing/routes.js +193 -0
- package/dist/src/billing/routes.js.map +1 -0
- package/dist/src/billing/stripe-client.d.ts +14 -0
- package/dist/src/billing/stripe-client.d.ts.map +1 -0
- package/dist/src/billing/stripe-client.js +51 -0
- package/dist/src/billing/stripe-client.js.map +1 -0
- package/dist/src/billing/webhook-handler.d.ts +19 -0
- package/dist/src/billing/webhook-handler.d.ts.map +1 -0
- package/dist/src/billing/webhook-handler.js +169 -0
- package/dist/src/billing/webhook-handler.js.map +1 -0
- package/dist/src/billing/webhook-routes.d.ts +5 -0
- package/dist/src/billing/webhook-routes.d.ts.map +1 -0
- package/dist/src/billing/webhook-routes.js +30 -0
- package/dist/src/billing/webhook-routes.js.map +1 -0
- package/dist/src/budget/manager.d.ts +95 -0
- package/dist/src/budget/manager.d.ts.map +1 -0
- package/dist/src/budget/manager.js +547 -0
- package/dist/src/budget/manager.js.map +1 -0
- package/dist/src/budget/usage-extractor.d.ts +38 -0
- package/dist/src/budget/usage-extractor.d.ts.map +1 -0
- package/dist/src/budget/usage-extractor.js +165 -0
- package/dist/src/budget/usage-extractor.js.map +1 -0
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +115 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config/defaults.d.ts +3 -0
- package/dist/src/config/defaults.d.ts.map +1 -0
- package/dist/src/config/defaults.js +243 -0
- package/dist/src/config/defaults.js.map +1 -0
- package/dist/src/config/validate.d.ts +15 -0
- package/dist/src/config/validate.d.ts.map +1 -0
- package/dist/src/config/validate.js +105 -0
- package/dist/src/config/validate.js.map +1 -0
- package/dist/src/dlp/composite-scanner.d.ts +47 -0
- package/dist/src/dlp/composite-scanner.d.ts.map +1 -0
- package/dist/src/dlp/composite-scanner.js +186 -0
- package/dist/src/dlp/composite-scanner.js.map +1 -0
- package/dist/src/dlp/index.d.ts +10 -0
- package/dist/src/dlp/index.d.ts.map +1 -0
- package/dist/src/dlp/index.js +26 -0
- package/dist/src/dlp/index.js.map +1 -0
- package/dist/src/dlp/interfaces.d.ts +33 -0
- package/dist/src/dlp/interfaces.d.ts.map +1 -0
- package/dist/src/dlp/interfaces.js +3 -0
- package/dist/src/dlp/interfaces.js.map +1 -0
- package/dist/src/dlp/patterns.d.ts +9 -0
- package/dist/src/dlp/patterns.d.ts.map +1 -0
- package/dist/src/dlp/patterns.js +25 -0
- package/dist/src/dlp/patterns.js.map +1 -0
- package/dist/src/dlp/prompt-injection-backend.d.ts +68 -0
- package/dist/src/dlp/prompt-injection-backend.d.ts.map +1 -0
- package/dist/src/dlp/prompt-injection-backend.js +148 -0
- package/dist/src/dlp/prompt-injection-backend.js.map +1 -0
- package/dist/src/dlp/prompt-injection-patterns.d.ts +32 -0
- package/dist/src/dlp/prompt-injection-patterns.d.ts.map +1 -0
- package/dist/src/dlp/prompt-injection-patterns.js +290 -0
- package/dist/src/dlp/prompt-injection-patterns.js.map +1 -0
- package/dist/src/dlp/regex-backend.d.ts +32 -0
- package/dist/src/dlp/regex-backend.d.ts.map +1 -0
- package/dist/src/dlp/regex-backend.js +153 -0
- package/dist/src/dlp/regex-backend.js.map +1 -0
- package/dist/src/dlp/scanner.d.ts +122 -0
- package/dist/src/dlp/scanner.d.ts.map +1 -0
- package/dist/src/dlp/scanner.js +444 -0
- package/dist/src/dlp/scanner.js.map +1 -0
- package/dist/src/dlp/text-normalizer.d.ts +41 -0
- package/dist/src/dlp/text-normalizer.d.ts.map +1 -0
- package/dist/src/dlp/text-normalizer.js +203 -0
- package/dist/src/dlp/text-normalizer.js.map +1 -0
- package/dist/src/dlp/trufflehog-backend.d.ts +64 -0
- package/dist/src/dlp/trufflehog-backend.d.ts.map +1 -0
- package/dist/src/dlp/trufflehog-backend.js +151 -0
- package/dist/src/dlp/trufflehog-backend.js.map +1 -0
- package/dist/src/executor/http-executor.d.ts +25 -0
- package/dist/src/executor/http-executor.d.ts.map +1 -0
- package/dist/src/executor/http-executor.js +333 -0
- package/dist/src/executor/http-executor.js.map +1 -0
- package/dist/src/executor/index.d.ts +6 -0
- package/dist/src/executor/index.d.ts.map +1 -0
- package/dist/src/executor/index.js +12 -0
- package/dist/src/executor/index.js.map +1 -0
- package/dist/src/executor/interfaces.d.ts +11 -0
- package/dist/src/executor/interfaces.d.ts.map +1 -0
- package/dist/src/executor/interfaces.js +3 -0
- package/dist/src/executor/interfaces.js.map +1 -0
- package/dist/src/executor/noop-executor.d.ts +13 -0
- package/dist/src/executor/noop-executor.d.ts.map +1 -0
- package/dist/src/executor/noop-executor.js +21 -0
- package/dist/src/executor/noop-executor.js.map +1 -0
- package/dist/src/executor/registry.d.ts +30 -0
- package/dist/src/executor/registry.d.ts.map +1 -0
- package/dist/src/executor/registry.js +62 -0
- package/dist/src/executor/registry.js.map +1 -0
- package/dist/src/executor/slack-executor.d.ts +24 -0
- package/dist/src/executor/slack-executor.d.ts.map +1 -0
- package/dist/src/executor/slack-executor.js +147 -0
- package/dist/src/executor/slack-executor.js.map +1 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +74 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/auth-verifier.d.ts +23 -0
- package/dist/src/mcp/auth-verifier.d.ts.map +1 -0
- package/dist/src/mcp/auth-verifier.js +162 -0
- package/dist/src/mcp/auth-verifier.js.map +1 -0
- package/dist/src/mcp/bridge.d.ts +132 -0
- package/dist/src/mcp/bridge.d.ts.map +1 -0
- package/dist/src/mcp/bridge.js +734 -0
- package/dist/src/mcp/bridge.js.map +1 -0
- package/dist/src/mcp/http-transport.d.ts +32 -0
- package/dist/src/mcp/http-transport.d.ts.map +1 -0
- package/dist/src/mcp/http-transport.js +538 -0
- package/dist/src/mcp/http-transport.js.map +1 -0
- package/dist/src/mcp/index.d.ts +10 -0
- package/dist/src/mcp/index.d.ts.map +1 -0
- package/dist/src/mcp/index.js +17 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/oauth-pages.d.ts +23 -0
- package/dist/src/mcp/oauth-pages.d.ts.map +1 -0
- package/dist/src/mcp/oauth-pages.js +121 -0
- package/dist/src/mcp/oauth-pages.js.map +1 -0
- package/dist/src/mcp/oauth-postgres-stores.d.ts +55 -0
- package/dist/src/mcp/oauth-postgres-stores.d.ts.map +1 -0
- package/dist/src/mcp/oauth-postgres-stores.js +226 -0
- package/dist/src/mcp/oauth-postgres-stores.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +95 -0
- package/dist/src/mcp/oauth-provider.d.ts.map +1 -0
- package/dist/src/mcp/oauth-provider.js +360 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -0
- package/dist/src/mcp/oauth-stores.d.ts +62 -0
- package/dist/src/mcp/oauth-stores.d.ts.map +1 -0
- package/dist/src/mcp/oauth-stores.js +154 -0
- package/dist/src/mcp/oauth-stores.js.map +1 -0
- package/dist/src/mcp/server.d.ts +18 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +51 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/metrics/collector.d.ts +106 -0
- package/dist/src/metrics/collector.d.ts.map +1 -0
- package/dist/src/metrics/collector.js +311 -0
- package/dist/src/metrics/collector.js.map +1 -0
- package/dist/src/metrics/index.d.ts +2 -0
- package/dist/src/metrics/index.d.ts.map +1 -0
- package/dist/src/metrics/index.js +6 -0
- package/dist/src/metrics/index.js.map +1 -0
- package/dist/src/middleware/auth.d.ts +77 -0
- package/dist/src/middleware/auth.d.ts.map +1 -0
- package/dist/src/middleware/auth.js +720 -0
- package/dist/src/middleware/auth.js.map +1 -0
- package/dist/src/middleware/session.d.ts +18 -0
- package/dist/src/middleware/session.d.ts.map +1 -0
- package/dist/src/middleware/session.js +67 -0
- package/dist/src/middleware/session.js.map +1 -0
- package/dist/src/middleware/validate.d.ts +3 -0
- package/dist/src/middleware/validate.d.ts.map +1 -0
- package/dist/src/middleware/validate.js +85 -0
- package/dist/src/middleware/validate.js.map +1 -0
- package/dist/src/policy/engine.d.ts +107 -0
- package/dist/src/policy/engine.d.ts.map +1 -0
- package/dist/src/policy/engine.js +646 -0
- package/dist/src/policy/engine.js.map +1 -0
- package/dist/src/policy/index.d.ts +3 -0
- package/dist/src/policy/index.d.ts.map +1 -0
- package/dist/src/policy/index.js +8 -0
- package/dist/src/policy/index.js.map +1 -0
- package/dist/src/policy/opa-engine.d.ts +176 -0
- package/dist/src/policy/opa-engine.d.ts.map +1 -0
- package/dist/src/policy/opa-engine.js +790 -0
- package/dist/src/policy/opa-engine.js.map +1 -0
- package/dist/src/proxy/forward-proxy.d.ts +30 -0
- package/dist/src/proxy/forward-proxy.d.ts.map +1 -0
- package/dist/src/proxy/forward-proxy.js +580 -0
- package/dist/src/proxy/forward-proxy.js.map +1 -0
- package/dist/src/proxy/index.d.ts +2 -0
- package/dist/src/proxy/index.d.ts.map +1 -0
- package/dist/src/proxy/index.js +8 -0
- package/dist/src/proxy/index.js.map +1 -0
- package/dist/src/ratelimit/limiter.d.ts +45 -0
- package/dist/src/ratelimit/limiter.d.ts.map +1 -0
- package/dist/src/ratelimit/limiter.js +158 -0
- package/dist/src/ratelimit/limiter.js.map +1 -0
- package/dist/src/replay/engine.d.ts +40 -0
- package/dist/src/replay/engine.d.ts.map +1 -0
- package/dist/src/replay/engine.js +106 -0
- package/dist/src/replay/engine.js.map +1 -0
- package/dist/src/replay/index.d.ts +2 -0
- package/dist/src/replay/index.d.ts.map +1 -0
- package/dist/src/replay/index.js +6 -0
- package/dist/src/replay/index.js.map +1 -0
- package/dist/src/saas/index.d.ts +2 -0
- package/dist/src/saas/index.d.ts.map +1 -0
- package/dist/src/saas/index.js +18 -0
- package/dist/src/saas/index.js.map +1 -0
- package/dist/src/saas/routes.d.ts +18 -0
- package/dist/src/saas/routes.d.ts.map +1 -0
- package/dist/src/saas/routes.js +1566 -0
- package/dist/src/saas/routes.js.map +1 -0
- package/dist/src/server/app.d.ts +44 -0
- package/dist/src/server/app.d.ts.map +1 -0
- package/dist/src/server/app.js +854 -0
- package/dist/src/server/app.js.map +1 -0
- package/dist/src/server/errors.d.ts +32 -0
- package/dist/src/server/errors.d.ts.map +1 -0
- package/dist/src/server/errors.js +39 -0
- package/dist/src/server/errors.js.map +1 -0
- package/dist/src/server/gateway.d.ts +165 -0
- package/dist/src/server/gateway.d.ts.map +1 -0
- package/dist/src/server/gateway.js +964 -0
- package/dist/src/server/gateway.js.map +1 -0
- package/dist/src/server/index.d.ts +2 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/src/server/index.js +295 -0
- package/dist/src/server/index.js.map +1 -0
- package/dist/src/server/logger.d.ts +33 -0
- package/dist/src/server/logger.d.ts.map +1 -0
- package/dist/src/server/logger.js +230 -0
- package/dist/src/server/logger.js.map +1 -0
- package/dist/src/server/stream-proxy.d.ts +32 -0
- package/dist/src/server/stream-proxy.d.ts.map +1 -0
- package/dist/src/server/stream-proxy.js +184 -0
- package/dist/src/server/stream-proxy.js.map +1 -0
- package/dist/src/storage/file-persistence.d.ts +48 -0
- package/dist/src/storage/file-persistence.d.ts.map +1 -0
- package/dist/src/storage/file-persistence.js +280 -0
- package/dist/src/storage/file-persistence.js.map +1 -0
- package/dist/src/storage/index.d.ts +5 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +21 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/interfaces.d.ts +237 -0
- package/dist/src/storage/interfaces.d.ts.map +1 -0
- package/dist/src/storage/interfaces.js +3 -0
- package/dist/src/storage/interfaces.js.map +1 -0
- package/dist/src/storage/memory.d.ts +162 -0
- package/dist/src/storage/memory.d.ts.map +1 -0
- package/dist/src/storage/memory.js +603 -0
- package/dist/src/storage/memory.js.map +1 -0
- package/dist/src/storage/postgres.d.ts +267 -0
- package/dist/src/storage/postgres.d.ts.map +1 -0
- package/dist/src/storage/postgres.js +1555 -0
- package/dist/src/storage/postgres.js.map +1 -0
- package/dist/src/storage/redis.d.ts +202 -0
- package/dist/src/storage/redis.d.ts.map +1 -0
- package/dist/src/storage/redis.js +629 -0
- package/dist/src/storage/redis.js.map +1 -0
- package/dist/src/tracing/index.d.ts +2 -0
- package/dist/src/tracing/index.d.ts.map +1 -0
- package/dist/src/tracing/index.js +6 -0
- package/dist/src/tracing/index.js.map +1 -0
- package/dist/src/tracing/provider.d.ts +43 -0
- package/dist/src/tracing/provider.d.ts.map +1 -0
- package/dist/src/tracing/provider.js +74 -0
- package/dist/src/tracing/provider.js.map +1 -0
- package/dist/src/trust/calculator.d.ts +54 -0
- package/dist/src/trust/calculator.d.ts.map +1 -0
- package/dist/src/trust/calculator.js +102 -0
- package/dist/src/trust/calculator.js.map +1 -0
- package/dist/src/trust/index.d.ts +2 -0
- package/dist/src/trust/index.d.ts.map +1 -0
- package/dist/src/trust/index.js +7 -0
- package/dist/src/trust/index.js.map +1 -0
- package/dist/src/types/budget.d.ts +30 -0
- package/dist/src/types/budget.d.ts.map +1 -0
- package/dist/src/types/budget.js +3 -0
- package/dist/src/types/budget.js.map +1 -0
- package/dist/src/types/config.d.ts +176 -0
- package/dist/src/types/config.d.ts.map +1 -0
- package/dist/src/types/config.js +3 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/events.d.ts +24 -0
- package/dist/src/types/events.d.ts.map +1 -0
- package/dist/src/types/events.js +3 -0
- package/dist/src/types/events.js.map +1 -0
- package/dist/src/types/index.d.ts +8 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +24 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/policy.d.ts +60 -0
- package/dist/src/types/policy.d.ts.map +1 -0
- package/dist/src/types/policy.js +3 -0
- package/dist/src/types/policy.js.map +1 -0
- package/dist/src/types/stripe-config.d.ts +12 -0
- package/dist/src/types/stripe-config.d.ts.map +1 -0
- package/dist/src/types/stripe-config.js +3 -0
- package/dist/src/types/stripe-config.js.map +1 -0
- package/dist/src/types/subscription.d.ts +24 -0
- package/dist/src/types/subscription.d.ts.map +1 -0
- package/dist/src/types/subscription.js +38 -0
- package/dist/src/types/subscription.js.map +1 -0
- package/dist/src/types/tool-call.d.ts +42 -0
- package/dist/src/types/tool-call.d.ts.map +1 -0
- package/dist/src/types/tool-call.js +3 -0
- package/dist/src/types/tool-call.js.map +1 -0
- package/dist/src/types/tool-result.d.ts +58 -0
- package/dist/src/types/tool-result.d.ts.map +1 -0
- package/dist/src/types/tool-result.js +3 -0
- package/dist/src/types/tool-result.js.map +1 -0
- package/dist/src/types/user.d.ts +101 -0
- package/dist/src/types/user.d.ts.map +1 -0
- package/dist/src/types/user.js +6 -0
- package/dist/src/types/user.js.map +1 -0
- package/dist/tests/integration/api.test.d.ts +2 -0
- package/dist/tests/integration/api.test.d.ts.map +1 -0
- package/dist/tests/integration/api.test.js +1199 -0
- package/dist/tests/integration/api.test.js.map +1 -0
- package/dist/tests/integration/proxy.test.d.ts +2 -0
- package/dist/tests/integration/proxy.test.d.ts.map +1 -0
- package/dist/tests/integration/proxy.test.js +251 -0
- package/dist/tests/integration/proxy.test.js.map +1 -0
- package/dist/tests/integration/storage.test.d.ts +16 -0
- package/dist/tests/integration/storage.test.d.ts.map +1 -0
- package/dist/tests/integration/storage.test.js +826 -0
- package/dist/tests/integration/storage.test.js.map +1 -0
- package/dist/tests/unit/admin.test.d.ts +2 -0
- package/dist/tests/unit/admin.test.d.ts.map +1 -0
- package/dist/tests/unit/admin.test.js +698 -0
- package/dist/tests/unit/admin.test.js.map +1 -0
- package/dist/tests/unit/anomaly-detector.test.d.ts +2 -0
- package/dist/tests/unit/anomaly-detector.test.d.ts.map +1 -0
- package/dist/tests/unit/anomaly-detector.test.js +903 -0
- package/dist/tests/unit/anomaly-detector.test.js.map +1 -0
- package/dist/tests/unit/approval-manager.test.d.ts +2 -0
- package/dist/tests/unit/approval-manager.test.d.ts.map +1 -0
- package/dist/tests/unit/approval-manager.test.js +528 -0
- package/dist/tests/unit/approval-manager.test.js.map +1 -0
- package/dist/tests/unit/approval-webhook.test.d.ts +2 -0
- package/dist/tests/unit/approval-webhook.test.d.ts.map +1 -0
- package/dist/tests/unit/approval-webhook.test.js +355 -0
- package/dist/tests/unit/approval-webhook.test.js.map +1 -0
- package/dist/tests/unit/audit-logger.test.d.ts +2 -0
- package/dist/tests/unit/audit-logger.test.d.ts.map +1 -0
- package/dist/tests/unit/audit-logger.test.js +635 -0
- package/dist/tests/unit/audit-logger.test.js.map +1 -0
- package/dist/tests/unit/auth-routes.test.d.ts +2 -0
- package/dist/tests/unit/auth-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/auth-routes.test.js +281 -0
- package/dist/tests/unit/auth-routes.test.js.map +1 -0
- package/dist/tests/unit/auth.test.d.ts +2 -0
- package/dist/tests/unit/auth.test.d.ts.map +1 -0
- package/dist/tests/unit/auth.test.js +1382 -0
- package/dist/tests/unit/auth.test.js.map +1 -0
- package/dist/tests/unit/billing.test.d.ts +2 -0
- package/dist/tests/unit/billing.test.d.ts.map +1 -0
- package/dist/tests/unit/billing.test.js +579 -0
- package/dist/tests/unit/billing.test.js.map +1 -0
- package/dist/tests/unit/budget-manager.test.d.ts +2 -0
- package/dist/tests/unit/budget-manager.test.d.ts.map +1 -0
- package/dist/tests/unit/budget-manager.test.js +778 -0
- package/dist/tests/unit/budget-manager.test.js.map +1 -0
- package/dist/tests/unit/budget-race.test.d.ts +2 -0
- package/dist/tests/unit/budget-race.test.d.ts.map +1 -0
- package/dist/tests/unit/budget-race.test.js +58 -0
- package/dist/tests/unit/budget-race.test.js.map +1 -0
- package/dist/tests/unit/cli.test.d.ts +2 -0
- package/dist/tests/unit/cli.test.d.ts.map +1 -0
- package/dist/tests/unit/cli.test.js +93 -0
- package/dist/tests/unit/cli.test.js.map +1 -0
- package/dist/tests/unit/concurrency.test.d.ts +2 -0
- package/dist/tests/unit/concurrency.test.d.ts.map +1 -0
- package/dist/tests/unit/concurrency.test.js +1270 -0
- package/dist/tests/unit/concurrency.test.js.map +1 -0
- package/dist/tests/unit/config-validate.test.d.ts +2 -0
- package/dist/tests/unit/config-validate.test.d.ts.map +1 -0
- package/dist/tests/unit/config-validate.test.js +230 -0
- package/dist/tests/unit/config-validate.test.js.map +1 -0
- package/dist/tests/unit/defaults.test.d.ts +2 -0
- package/dist/tests/unit/defaults.test.d.ts.map +1 -0
- package/dist/tests/unit/defaults.test.js +364 -0
- package/dist/tests/unit/defaults.test.js.map +1 -0
- package/dist/tests/unit/dlp-backends.test.d.ts +2 -0
- package/dist/tests/unit/dlp-backends.test.d.ts.map +1 -0
- package/dist/tests/unit/dlp-backends.test.js +563 -0
- package/dist/tests/unit/dlp-backends.test.js.map +1 -0
- package/dist/tests/unit/dlp-scanner.test.d.ts +2 -0
- package/dist/tests/unit/dlp-scanner.test.d.ts.map +1 -0
- package/dist/tests/unit/dlp-scanner.test.js +739 -0
- package/dist/tests/unit/dlp-scanner.test.js.map +1 -0
- package/dist/tests/unit/error-responses.test.d.ts +2 -0
- package/dist/tests/unit/error-responses.test.d.ts.map +1 -0
- package/dist/tests/unit/error-responses.test.js +101 -0
- package/dist/tests/unit/error-responses.test.js.map +1 -0
- package/dist/tests/unit/executor-registry.test.d.ts +2 -0
- package/dist/tests/unit/executor-registry.test.d.ts.map +1 -0
- package/dist/tests/unit/executor-registry.test.js +390 -0
- package/dist/tests/unit/executor-registry.test.js.map +1 -0
- package/dist/tests/unit/forward-proxy.test.d.ts +2 -0
- package/dist/tests/unit/forward-proxy.test.d.ts.map +1 -0
- package/dist/tests/unit/forward-proxy.test.js +621 -0
- package/dist/tests/unit/forward-proxy.test.js.map +1 -0
- package/dist/tests/unit/gateway-features.test.d.ts +2 -0
- package/dist/tests/unit/gateway-features.test.d.ts.map +1 -0
- package/dist/tests/unit/gateway-features.test.js +753 -0
- package/dist/tests/unit/gateway-features.test.js.map +1 -0
- package/dist/tests/unit/http-executor.test.d.ts +2 -0
- package/dist/tests/unit/http-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/http-executor.test.js +310 -0
- package/dist/tests/unit/http-executor.test.js.map +1 -0
- package/dist/tests/unit/mcp-bridge.test.d.ts +2 -0
- package/dist/tests/unit/mcp-bridge.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-bridge.test.js +1136 -0
- package/dist/tests/unit/mcp-bridge.test.js.map +1 -0
- package/dist/tests/unit/mcp-http-transport.test.d.ts +2 -0
- package/dist/tests/unit/mcp-http-transport.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-http-transport.test.js +899 -0
- package/dist/tests/unit/mcp-http-transport.test.js.map +1 -0
- package/dist/tests/unit/mcp-oauth.test.d.ts +2 -0
- package/dist/tests/unit/mcp-oauth.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-oauth.test.js +759 -0
- package/dist/tests/unit/mcp-oauth.test.js.map +1 -0
- package/dist/tests/unit/mcp-server.test.d.ts +15 -0
- package/dist/tests/unit/mcp-server.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-server.test.js +158 -0
- package/dist/tests/unit/mcp-server.test.js.map +1 -0
- package/dist/tests/unit/metrics.test.d.ts +2 -0
- package/dist/tests/unit/metrics.test.d.ts.map +1 -0
- package/dist/tests/unit/metrics.test.js +208 -0
- package/dist/tests/unit/metrics.test.js.map +1 -0
- package/dist/tests/unit/oauth.test.d.ts +2 -0
- package/dist/tests/unit/oauth.test.d.ts.map +1 -0
- package/dist/tests/unit/oauth.test.js +281 -0
- package/dist/tests/unit/oauth.test.js.map +1 -0
- package/dist/tests/unit/opa-circuit-breaker.test.d.ts +2 -0
- package/dist/tests/unit/opa-circuit-breaker.test.d.ts.map +1 -0
- package/dist/tests/unit/opa-circuit-breaker.test.js +297 -0
- package/dist/tests/unit/opa-circuit-breaker.test.js.map +1 -0
- package/dist/tests/unit/opa-engine.test.d.ts +2 -0
- package/dist/tests/unit/opa-engine.test.d.ts.map +1 -0
- package/dist/tests/unit/opa-engine.test.js +1813 -0
- package/dist/tests/unit/opa-engine.test.js.map +1 -0
- package/dist/tests/unit/pipeline-timing.test.d.ts +2 -0
- package/dist/tests/unit/pipeline-timing.test.d.ts.map +1 -0
- package/dist/tests/unit/pipeline-timing.test.js +528 -0
- package/dist/tests/unit/pipeline-timing.test.js.map +1 -0
- package/dist/tests/unit/policy-engine.test.d.ts +2 -0
- package/dist/tests/unit/policy-engine.test.d.ts.map +1 -0
- package/dist/tests/unit/policy-engine.test.js +1345 -0
- package/dist/tests/unit/policy-engine.test.js.map +1 -0
- package/dist/tests/unit/policy-store.test.d.ts +2 -0
- package/dist/tests/unit/policy-store.test.d.ts.map +1 -0
- package/dist/tests/unit/policy-store.test.js +60 -0
- package/dist/tests/unit/policy-store.test.js.map +1 -0
- package/dist/tests/unit/postgres-storage.test.d.ts +2 -0
- package/dist/tests/unit/postgres-storage.test.d.ts.map +1 -0
- package/dist/tests/unit/postgres-storage.test.js +614 -0
- package/dist/tests/unit/postgres-storage.test.js.map +1 -0
- package/dist/tests/unit/prompt-injection-backend.test.d.ts +2 -0
- package/dist/tests/unit/prompt-injection-backend.test.d.ts.map +1 -0
- package/dist/tests/unit/prompt-injection-backend.test.js +621 -0
- package/dist/tests/unit/prompt-injection-backend.test.js.map +1 -0
- package/dist/tests/unit/proxy-hardening.test.d.ts +2 -0
- package/dist/tests/unit/proxy-hardening.test.d.ts.map +1 -0
- package/dist/tests/unit/proxy-hardening.test.js +166 -0
- package/dist/tests/unit/proxy-hardening.test.js.map +1 -0
- package/dist/tests/unit/rate-limiter.test.d.ts +2 -0
- package/dist/tests/unit/rate-limiter.test.d.ts.map +1 -0
- package/dist/tests/unit/rate-limiter.test.js +443 -0
- package/dist/tests/unit/rate-limiter.test.js.map +1 -0
- package/dist/tests/unit/redis-storage.test.d.ts +2 -0
- package/dist/tests/unit/redis-storage.test.d.ts.map +1 -0
- package/dist/tests/unit/redis-storage.test.js +766 -0
- package/dist/tests/unit/redis-storage.test.js.map +1 -0
- package/dist/tests/unit/replay-engine.test.d.ts +2 -0
- package/dist/tests/unit/replay-engine.test.d.ts.map +1 -0
- package/dist/tests/unit/replay-engine.test.js +371 -0
- package/dist/tests/unit/replay-engine.test.js.map +1 -0
- package/dist/tests/unit/saas-routes.test.d.ts +2 -0
- package/dist/tests/unit/saas-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/saas-routes.test.js +1399 -0
- package/dist/tests/unit/saas-routes.test.js.map +1 -0
- package/dist/tests/unit/session.test.d.ts +2 -0
- package/dist/tests/unit/session.test.d.ts.map +1 -0
- package/dist/tests/unit/session.test.js +532 -0
- package/dist/tests/unit/session.test.js.map +1 -0
- package/dist/tests/unit/slack-executor.test.d.ts +2 -0
- package/dist/tests/unit/slack-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/slack-executor.test.js +209 -0
- package/dist/tests/unit/slack-executor.test.js.map +1 -0
- package/dist/tests/unit/storage-hardening.test.d.ts +2 -0
- package/dist/tests/unit/storage-hardening.test.d.ts.map +1 -0
- package/dist/tests/unit/storage-hardening.test.js +165 -0
- package/dist/tests/unit/storage-hardening.test.js.map +1 -0
- package/dist/tests/unit/storage.test.d.ts +2 -0
- package/dist/tests/unit/storage.test.d.ts.map +1 -0
- package/dist/tests/unit/storage.test.js +698 -0
- package/dist/tests/unit/storage.test.js.map +1 -0
- package/dist/tests/unit/text-normalizer.test.d.ts +2 -0
- package/dist/tests/unit/text-normalizer.test.d.ts.map +1 -0
- package/dist/tests/unit/text-normalizer.test.js +229 -0
- package/dist/tests/unit/text-normalizer.test.js.map +1 -0
- package/dist/tests/unit/tracing.test.d.ts +2 -0
- package/dist/tests/unit/tracing.test.d.ts.map +1 -0
- package/dist/tests/unit/tracing.test.js +611 -0
- package/dist/tests/unit/tracing.test.js.map +1 -0
- package/dist/tests/unit/trust-calculator.test.d.ts +2 -0
- package/dist/tests/unit/trust-calculator.test.d.ts.map +1 -0
- package/dist/tests/unit/trust-calculator.test.js +497 -0
- package/dist/tests/unit/trust-calculator.test.js.map +1 -0
- package/dist/tests/unit/ts-sdk.test.d.ts +2 -0
- package/dist/tests/unit/ts-sdk.test.d.ts.map +1 -0
- package/dist/tests/unit/ts-sdk.test.js +421 -0
- package/dist/tests/unit/ts-sdk.test.js.map +1 -0
- package/dist/tests/unit/usage-extractor-llm.test.d.ts +2 -0
- package/dist/tests/unit/usage-extractor-llm.test.d.ts.map +1 -0
- package/dist/tests/unit/usage-extractor-llm.test.js +139 -0
- package/dist/tests/unit/usage-extractor-llm.test.js.map +1 -0
- package/dist/tests/unit/usage-extractor.test.d.ts +2 -0
- package/dist/tests/unit/usage-extractor.test.d.ts.map +1 -0
- package/dist/tests/unit/usage-extractor.test.js +271 -0
- package/dist/tests/unit/usage-extractor.test.js.map +1 -0
- package/dist/tests/unit/user-stores.test.d.ts +2 -0
- package/dist/tests/unit/user-stores.test.d.ts.map +1 -0
- package/dist/tests/unit/user-stores.test.js +687 -0
- package/dist/tests/unit/user-stores.test.js.map +1 -0
- package/dist/tests/unit/validate.test.d.ts +2 -0
- package/dist/tests/unit/validate.test.d.ts.map +1 -0
- package/dist/tests/unit/validate.test.js +545 -0
- package/dist/tests/unit/validate.test.js.map +1 -0
- package/package.json +86 -0
- package/policy-packs/README.md +42 -0
- package/policy-packs/default.yaml +46 -0
- package/policy-packs/dev_fast.yaml +54 -0
- package/policy-packs/prod_strict.yaml +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
# Palaryn
|
|
2
|
+
|
|
3
|
+
**A model-agnostic infrastructure layer that gives AI agents safe, auditable, and cost-controlled access to the outside world.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
As AI agents increasingly interact with external services -- sending HTTP requests, posting to Slack, committing to Git, querying databases -- the central challenge shifts from model intelligence to **execution control**. Without guardrails, agents can leak secrets, overspend budgets, trigger unintended writes, and leave no trace of what happened. Enterprise procurement teams will not approve agent deployments that lack policy enforcement, cost controls, and auditable logs.
|
|
10
|
+
|
|
11
|
+
Palaryn solves this by sitting as a single choke point between AI agents and the external world. Every tool call -- whether it targets a SaaS API, a database, a Git provider, Slack, or a headless browser -- is intercepted, evaluated against security policies, checked for sensitive data, metered against budgets, and logged immutably. The gateway is completely model-agnostic: it works with Claude, OpenAI, LangGraph, n8n, or any custom orchestrator. Integration requires nothing more than swapping an endpoint or embedding the SDK.
|
|
12
|
+
|
|
13
|
+
The product is built around three pillars: **Security and DLP** to prevent data exfiltration and enforce least-privilege access; **Cost and Budget Controls** to stop runaway spending from agent loops and retries; and **Audit and Observability** to provide full traceability, replay capability, and compliance-ready export to SIEM and GRC platforms.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
|
|
21
|
+
- Node.js 20+
|
|
22
|
+
- npm
|
|
23
|
+
|
|
24
|
+
### Install, Build, and Run
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Clone the repository
|
|
28
|
+
git clone <repo-url> && cd palaryn
|
|
29
|
+
|
|
30
|
+
# Install dependencies
|
|
31
|
+
npm install
|
|
32
|
+
|
|
33
|
+
# Build the TypeScript project
|
|
34
|
+
npm run build
|
|
35
|
+
|
|
36
|
+
# Start the gateway
|
|
37
|
+
npm start
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The gateway starts on **port 3000** by default. Verify it is running:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
curl http://localhost:3000/health
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Execute Your First Tool Call
|
|
47
|
+
|
|
48
|
+
Send a tool call through the gateway using the default API key (`dev-key-001`):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
curl -X POST http://localhost:3000/v1/tool/execute \
|
|
52
|
+
-H "Content-Type: application/json" \
|
|
53
|
+
-H "X-API-Key: dev-key-001" \
|
|
54
|
+
-d '{
|
|
55
|
+
"tool_call_id": "tc-001",
|
|
56
|
+
"task_id": "task-001",
|
|
57
|
+
"actor": { "type": "agent", "id": "agent-1" },
|
|
58
|
+
"source": { "platform": "custom" },
|
|
59
|
+
"tool": { "name": "http.request", "capability": "read" },
|
|
60
|
+
"args": { "method": "GET", "url": "https://httpbin.org/get" }
|
|
61
|
+
}'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The response includes the policy decision, DLP scan results, budget report, and the tool output -- all in a single `ToolResult` envelope.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Project Structure
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
/
|
|
72
|
+
├── src/
|
|
73
|
+
│ ├── types/ # Canonical schemas (ToolCall, ToolResult, Policy, Events, Budget, Config)
|
|
74
|
+
│ ├── policy/ # Policy engine (YAML DSL evaluation)
|
|
75
|
+
│ ├── dlp/ # DLP scanner (secrets + PII detection, redaction)
|
|
76
|
+
│ ├── budget/ # Budget manager (per-task/user/org budgets, hard stops)
|
|
77
|
+
│ ├── audit/ # Audit logger (immutable event log, trace reconstruction)
|
|
78
|
+
│ ├── executor/ # HTTP executor (retries, backoff, caching)
|
|
79
|
+
│ ├── approval/ # Approval manager (JWT tokens, time-bound approvals)
|
|
80
|
+
│ ├── server/ # Express gateway server + request orchestration
|
|
81
|
+
│ ├── middleware/ # Auth and validation middleware
|
|
82
|
+
│ ├── config/ # Default configuration + startup validation
|
|
83
|
+
│ └── index.ts # Package exports
|
|
84
|
+
├── sdk/typescript/ # TypeScript SDK client
|
|
85
|
+
│ └── src/
|
|
86
|
+
│ ├── client.ts # PalarynClient class with full API coverage
|
|
87
|
+
│ └── index.ts # SDK exports
|
|
88
|
+
├── policy-packs/ # Pre-built YAML policy configurations
|
|
89
|
+
│ ├── default.yaml # Default safe (reads allowed, writes need approval)
|
|
90
|
+
│ ├── dev_fast.yaml # Development (permissive reads + writes)
|
|
91
|
+
│ └── prod_strict.yaml # Production strict (minimal permissions)
|
|
92
|
+
├── tests/
|
|
93
|
+
│ ├── unit/ # 1551 unit tests across 37 suites
|
|
94
|
+
│ └── integration/ # 123 integration tests (65 run + 58 auto-skip without Redis/Postgres)
|
|
95
|
+
├── examples/ # Usage examples
|
|
96
|
+
├── docs/ # Product documentation (13 markdown files)
|
|
97
|
+
├── Dockerfile # Multi-stage production Docker build
|
|
98
|
+
├── docker-compose.yaml # Docker Compose with dev and prod services
|
|
99
|
+
├── tsconfig.json # TypeScript configuration
|
|
100
|
+
└── package.json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
### Commands
|
|
108
|
+
|
|
109
|
+
| Command | Description |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `npm install` | Install dependencies |
|
|
112
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|
|
113
|
+
| `npm start` | Start the gateway in production mode (requires build) |
|
|
114
|
+
| `npm run dev` | Start the gateway in development mode (ts-node, no build needed) |
|
|
115
|
+
| `npm test` | Run all 1616 tests (40 suites) |
|
|
116
|
+
| `npm run test:unit` | Run 1551 unit tests (37 suites) |
|
|
117
|
+
| `npm run test:integration` | Run 123 integration tests (65 + 58 auto-skip without services) |
|
|
118
|
+
| `npm run lint` | Run ESLint on `src/` and `tests/` |
|
|
119
|
+
| `npm run clean` | Remove `dist/` build output |
|
|
120
|
+
|
|
121
|
+
### Environment Variables
|
|
122
|
+
|
|
123
|
+
| Variable | Default | Description |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `PORT` | `3000` | HTTP server port |
|
|
126
|
+
| `HOST` | `0.0.0.0` | HTTP server bind address |
|
|
127
|
+
| `NODE_ENV` | `development` | Environment (development / production) |
|
|
128
|
+
| `AUTH_ENABLED` | `true` | Enable/disable API key authentication |
|
|
129
|
+
| `POLICY_PACK_PATH` | `./policy-packs/default.yaml` | Path to the active policy pack |
|
|
130
|
+
| `AUDIT_LOG_DIR` | `./logs` | Directory for immutable audit logs |
|
|
131
|
+
| `JWT_SECRET` | -- | Secret for signing approval JWT tokens |
|
|
132
|
+
| `APPROVAL_SECRET` | -- | Secret for signing approval workflow tokens |
|
|
133
|
+
| `REDIS_URL` | -- | Redis connection URL (e.g. `redis://redis:6379`) |
|
|
134
|
+
| `DATABASE_URL` | -- | PostgreSQL connection URL |
|
|
135
|
+
|
|
136
|
+
### Running in Development
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Start with hot-reload via ts-node
|
|
140
|
+
npm run dev
|
|
141
|
+
|
|
142
|
+
# Run tests in watch mode
|
|
143
|
+
npx jest --watch
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Testing
|
|
149
|
+
|
|
150
|
+
The test suite covers all core components with 1616 tests across 40 suites (unit + integration).
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Run everything
|
|
154
|
+
npm test
|
|
155
|
+
|
|
156
|
+
# Run unit tests only (1551 tests across 37 suites)
|
|
157
|
+
npm run test:unit
|
|
158
|
+
|
|
159
|
+
# Run integration tests only (123 tests, 65 run + 58 auto-skip without Redis/Postgres)
|
|
160
|
+
npm run test:integration
|
|
161
|
+
|
|
162
|
+
# Run a specific test file
|
|
163
|
+
npx jest tests/unit/policy.test.ts
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Unit test suites cover the policy engine, DLP scanner (regex, TruffleHog, composite backends), budget manager, audit logger, executor registry (HTTP, Slack, no-op), approval manager, rate limiter, all storage backends (memory, PostgreSQL, Redis), Prometheus metrics, OpenTelemetry tracing, JWT/OIDC auth with RBAC, admin dashboard, MCP bridge, anomaly detector, OPA/Rego engine, TypeScript SDK, SaaS routes, and full gateway features. Integration tests exercise the full gateway server end-to-end through the HTTP API, plus Redis/Postgres storage integration tests that auto-skip without running services.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Docker
|
|
171
|
+
|
|
172
|
+
### Production
|
|
173
|
+
|
|
174
|
+
Build and run the gateway with the multi-stage Dockerfile (Node.js 20 Alpine, non-root user):
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Build and start with Docker Compose
|
|
178
|
+
docker compose up gateway
|
|
179
|
+
|
|
180
|
+
# Or build the image directly
|
|
181
|
+
docker build -t palaryn .
|
|
182
|
+
docker run -p 3000:3000 palaryn
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The production image runs as a non-root `palaryn` user, includes a health check, and ships with the compiled JavaScript and policy packs only (no source or dev dependencies).
|
|
186
|
+
|
|
187
|
+
### Development
|
|
188
|
+
|
|
189
|
+
The Compose file includes a `gateway-dev` service that mounts the source directory for live editing:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
docker compose --profile dev up gateway-dev
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Docker Compose Environment
|
|
196
|
+
|
|
197
|
+
The `docker-compose.yaml` configures both services with sensible defaults. Policy packs are mounted as a read-only volume so you can edit them on the host and restart the gateway to pick up changes.
|
|
198
|
+
|
|
199
|
+
```yaml
|
|
200
|
+
# Key environment defaults (override as needed)
|
|
201
|
+
NODE_ENV=production
|
|
202
|
+
PORT=3000
|
|
203
|
+
AUTH_ENABLED=true
|
|
204
|
+
POLICY_PACK_PATH=./policy-packs/default.yaml
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## SDK
|
|
210
|
+
|
|
211
|
+
### TypeScript SDK
|
|
212
|
+
|
|
213
|
+
The TypeScript SDK (`sdk/typescript/`) provides a `PalarynClient` class for programmatic access to the gateway from any Node.js application or agent orchestrator.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import { PalarynClient } from './sdk/typescript/src';
|
|
217
|
+
|
|
218
|
+
// Set defaults once -- no need to repeat actor/platform on every call
|
|
219
|
+
const client = new PalarynClient({
|
|
220
|
+
gateway_url: 'http://localhost:3000',
|
|
221
|
+
api_key: 'dev-key-001',
|
|
222
|
+
timeout_ms: 30000,
|
|
223
|
+
defaults: {
|
|
224
|
+
actor: { type: 'agent', id: 'my-agent' },
|
|
225
|
+
platform: 'langgraph',
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// Convenience methods use defaults automatically
|
|
230
|
+
const getResult = await client.httpGet('task-001', 'https://httpbin.org/get');
|
|
231
|
+
const postResult = await client.httpPost('task-002', 'https://httpbin.org/post', { key: 'value' });
|
|
232
|
+
|
|
233
|
+
// Override defaults per-call when needed
|
|
234
|
+
const customResult = await client.httpGet('task-003', 'https://httpbin.org/get',
|
|
235
|
+
{ type: 'user', id: 'admin-1' }, 'custom');
|
|
236
|
+
|
|
237
|
+
// Execute a full tool call
|
|
238
|
+
const result = await client.executeTool({
|
|
239
|
+
task_id: 'task-004',
|
|
240
|
+
actor: { type: 'agent', id: 'my-agent' },
|
|
241
|
+
source: { platform: 'langgraph' },
|
|
242
|
+
tool: { name: 'http.request', capability: 'read' },
|
|
243
|
+
args: { method: 'GET', url: 'https://api.github.com/repos/owner/repo' },
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Approval workflows
|
|
247
|
+
const pending = await client.getPendingApprovals();
|
|
248
|
+
await client.approve(approvalToken, 'approver-1');
|
|
249
|
+
await client.deny(approvalToken, 'approver-1', 'Not authorized');
|
|
250
|
+
|
|
251
|
+
// Observability
|
|
252
|
+
const trace = await client.getTaskTrace('task-001');
|
|
253
|
+
const policy = await client.getCurrentPolicy();
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
The client covers all gateway endpoints: `executeTool`, `approve`, `deny`, `getTaskTrace`, `getCurrentPolicy`, `validatePolicy`, `getPendingApprovals`, and `health`.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Policy Packs
|
|
261
|
+
|
|
262
|
+
Policy packs are YAML files that define security rules, domain allowlists, and approval requirements. Three pre-built packs are included (see [`policy-packs/README.md`](policy-packs/README.md) for a detailed comparison):
|
|
263
|
+
|
|
264
|
+
| Pack | File | Description |
|
|
265
|
+
|---|---|---|
|
|
266
|
+
| **Default Safe** | `policy-packs/default.yaml` | SSRF protection, reads allowed, writes need approval, deny delete/admin |
|
|
267
|
+
| **Dev Fast** | `policy-packs/dev_fast.yaml` | Permissive reads and writes for development |
|
|
268
|
+
| **Prod Strict** | `policy-packs/prod_strict.yaml` | Minimal permissions for production workloads |
|
|
269
|
+
|
|
270
|
+
### Example Policy Rule
|
|
271
|
+
|
|
272
|
+
```yaml
|
|
273
|
+
rules:
|
|
274
|
+
- name: "Require approval for write operations"
|
|
275
|
+
description: "All write/delete/admin operations require human approval"
|
|
276
|
+
effect: REQUIRE_APPROVAL
|
|
277
|
+
priority: 20
|
|
278
|
+
conditions:
|
|
279
|
+
capabilities:
|
|
280
|
+
- "write"
|
|
281
|
+
- "delete"
|
|
282
|
+
- "admin"
|
|
283
|
+
approval:
|
|
284
|
+
scope: "team_lead"
|
|
285
|
+
ttl_seconds: 3600
|
|
286
|
+
reason: "Write/delete/admin operations require approval"
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Set the active policy pack with the `POLICY_PACK_PATH` environment variable or at startup.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## API Endpoints
|
|
294
|
+
|
|
295
|
+
| Method | Endpoint | Description |
|
|
296
|
+
|---|---|---|
|
|
297
|
+
| `GET` | `/health` | Health check (status, version, timestamp -- always returns 200) |
|
|
298
|
+
| `GET` | `/ready` | Readiness probe (returns 503 when unhealthy, for K8s) |
|
|
299
|
+
| `GET` | `/metrics` | Prometheus metrics (no auth required) |
|
|
300
|
+
| `POST` | `/v1/tool/execute` | Execute a tool call through the gateway |
|
|
301
|
+
| `POST` | `/v1/tool/approve` | Approve or deny a pending action |
|
|
302
|
+
| `GET` | `/v1/tasks/{task_id}/trace` | Retrieve the full trace for a task |
|
|
303
|
+
| `GET` | `/v1/policies/current` | Get the active policy configuration |
|
|
304
|
+
| `POST` | `/v1/policies/validate` | Validate a policy configuration before deployment |
|
|
305
|
+
| `GET` | `/v1/config/active` | Get active configuration (admin-only, secrets redacted) |
|
|
306
|
+
| `GET` | `/v1/approvals/pending` | List pending approval requests |
|
|
307
|
+
|
|
308
|
+
All endpoints (except `/health`, `/ready`, `/metrics`) require authentication via the `X-API-Key` header when `AUTH_ENABLED=true`.
|
|
309
|
+
|
|
310
|
+
### Error Responses
|
|
311
|
+
|
|
312
|
+
All error responses follow a standardized format with machine-readable error codes and actionable hints:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"error": "Rate limit exceeded for actor agent-1",
|
|
317
|
+
"error_code": "RATE_LIMIT_EXCEEDED",
|
|
318
|
+
"details": { "retry_after_ms": 5000 },
|
|
319
|
+
"hint": "Retry after the reset time or increase rate_limit config"
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Error codes: `VALIDATION_FAILED`, `AUTH_REQUIRED`, `AUTH_INVALID_KEY`, `AUTH_KEY_EXPIRED`, `AUTH_KEY_REVOKED`, `AUTH_INSUFFICIENT_PERMS`, `RATE_LIMIT_EXCEEDED`, `POLICY_DENIED`, `BUDGET_EXCEEDED`, `APPROVAL_REQUIRED`, `TOOL_EXECUTION_ERROR`, `INTERNAL_ERROR`, `NOT_FOUND`, `REQUEST_TIMEOUT`.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Key Features
|
|
328
|
+
|
|
329
|
+
### Security & DLP
|
|
330
|
+
|
|
331
|
+
- **Least-privilege enforcement** -- Tools declare capabilities (read/write/delete/admin); policies gate access by capability level, with write operations requiring approval by default
|
|
332
|
+
- **Destination allowlists** -- Domain-level allowlisting with no wildcards by default; IP literals blocked; optional path-level control
|
|
333
|
+
- **DLP scanning** -- Entropy-based and pattern-based detection of secrets (API keys, JWTs, OAuth tokens) and PII (emails, phone numbers, addresses) in both request arguments and response outputs
|
|
334
|
+
- **Redaction strategies** -- Mask (preserve shape), hash (stable for correlation), drop (remove entirely), or tokenize (replace with placeholders)
|
|
335
|
+
- **Incident handling** -- Severity scoring based on destination, data type, and capability; automatic notifications via Slack or webhook; auto-quarantine of keys on severe exfiltration attempts
|
|
336
|
+
- **Approval workflows** -- Asynchronous, signed, time-bound approvals for risky actions; approver scopes include team lead, security, and admin roles
|
|
337
|
+
- **Compliance posture** -- SOC2-friendly logging, configurable data retention, encryption at rest and in transit
|
|
338
|
+
|
|
339
|
+
### Cost & Budget Controls
|
|
340
|
+
|
|
341
|
+
- **Granular budgets** -- Set spending limits per task, per user/agent, per workspace, and per tool type (e.g., higher limits for HTTP, tighter limits for browserless)
|
|
342
|
+
- **Hard stops** -- Maximum steps per task, maximum retries per tool call, and maximum wall-clock time per task
|
|
343
|
+
- **Response caching** -- Optional TTL-based caching of GET responses and deduplication of idempotent calls to reduce costs
|
|
344
|
+
- **Anomaly detection** -- Rolling baselines per workspace and tool; alerts triggered when costs or retry rates exceed configurable thresholds
|
|
345
|
+
- **Cost reporting** -- Dashboards showing top spenders, noisiest tools, and blocked actions; CSV/JSON export for finance teams
|
|
346
|
+
|
|
347
|
+
### Audit & Observability
|
|
348
|
+
|
|
349
|
+
- **Append-only event log** -- Immutable storage with optional WORM (Write Once Read Many) support for compliance
|
|
350
|
+
- **Structured event schema** -- Events for every stage: `TOOL_CALL_RECEIVED`, `POLICY_DECIDED`, `DLP_SCANNED`, `BUDGET_CHECKED`, `TOOL_EXECUTED`, `TOOL_RESULT_RETURNED`, `APPROVAL_REQUESTED`, `INCIDENT_RAISED`, and more
|
|
351
|
+
- **Correlation IDs** -- Full traceability via `task_id` and `tool_call_id` across the entire tool call lifecycle
|
|
352
|
+
- **Replayable traces** -- Reconstruct any task timeline; optionally re-run tool calls in a sandbox environment (enterprise feature)
|
|
353
|
+
- **OpenTelemetry integration** -- Spans per tool call; metrics for latency, error rate, block rate, approvals, and cost
|
|
354
|
+
- **SIEM/GRC export** -- Webhook sinks, Splunk/Elastic format templates, and daily digest reports
|
|
355
|
+
|
|
356
|
+
## Architecture Summary
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
Agents / Orchestrators
|
|
360
|
+
(Claude Code, LangGraph, n8n, custom control rooms, vendor platforms)
|
|
361
|
+
|
|
|
362
|
+
| ToolCall: toolName + args + context
|
|
363
|
+
v
|
|
364
|
+
+------------------------------+
|
|
365
|
+
| Palaryn |
|
|
366
|
+
+------------------------------+
|
|
367
|
+
| | | | |
|
|
368
|
+
| | | | +--> Audit Store (immutable logs)
|
|
369
|
+
| | | +---------> Metrics / Tracing (OpenTelemetry)
|
|
370
|
+
| | +----------------> Policy Engine (OPA / custom YAML DSL)
|
|
371
|
+
| +----------------------> DLP Engine (PII / secrets detection)
|
|
372
|
+
+--------------------------> Tool Executors (HTTP, Slack, Git, DB, Browserless)
|
|
373
|
+
|
|
|
374
|
+
v
|
|
375
|
+
External World / Internal Services
|
|
376
|
+
(SaaS APIs, databases, Git providers, Slack/Teams, microservices)
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
**Core principle: all agent I/O goes through a single choke point.** Even if an agent is highly capable, it never gets direct, unmediated access to external services.
|
|
380
|
+
|
|
381
|
+
### Runtime Path (per tool call)
|
|
382
|
+
|
|
383
|
+
1. **Authenticate** the request (API key, JWT, or mTLS)
|
|
384
|
+
2. **Normalize** the ToolCall into a canonical schema
|
|
385
|
+
3. **Evaluate policy** -- allow, deny, transform, or require approval
|
|
386
|
+
4. **Scan for DLP** -- detect secrets and PII in arguments and outputs; apply redaction
|
|
387
|
+
5. **Check budget** -- verify per-task/user/org limits; enforce rate limiting
|
|
388
|
+
6. **Execute** the tool call (with retries and backoff)
|
|
389
|
+
7. **Log** an immutable trace event
|
|
390
|
+
8. **Return** the ToolResult with metadata (cost, policy decision, warnings)
|
|
391
|
+
|
|
392
|
+
### Design Non-Negotiables
|
|
393
|
+
|
|
394
|
+
- Deterministic behavior: policy decides, the model cannot override
|
|
395
|
+
- No bypass path
|
|
396
|
+
- Clear audit trail for every action
|
|
397
|
+
- Safe defaults: deny-by-default for unknown tools and domains
|
|
398
|
+
|
|
399
|
+
## Integration Patterns
|
|
400
|
+
|
|
401
|
+
Palaryn has a single pipeline (auth → rate limit → policy → DLP → budget → execute → audit) with **4 entry points**. Each environment picks the one that requires the least change.
|
|
402
|
+
|
|
403
|
+
### Entry Points
|
|
404
|
+
|
|
405
|
+
| Entry Point | Protocol | Code Change | Best For |
|
|
406
|
+
|---|---|---|---|
|
|
407
|
+
| **Direct API** (`POST /v1/tool/execute`) | HTTP | Minimal — send JSON | Any HTTP-capable system |
|
|
408
|
+
| **SDK** (TypeScript / Python) | HTTP (wrapped) | Import + wrapper | Custom agents, orchestrators |
|
|
409
|
+
| **Forward Proxy** (`:3128`) | `HTTP_PROXY` env var | Zero | Containers, K8s, sandbox |
|
|
410
|
+
| **MCP Bridge** | JSON-RPC over stdio | Zero — config only | Claude Code, Cursor, IDE agents |
|
|
411
|
+
| **MCP HTTP** (`/mcp`) | Streamable HTTP | Zero — URL only | Hosted/remote MCP server |
|
|
412
|
+
|
|
413
|
+
### Agent Frameworks (LangGraph, CrewAI, custom)
|
|
414
|
+
|
|
415
|
+
Use the Python or TypeScript SDK as a wrapper around tool calls:
|
|
416
|
+
|
|
417
|
+
```python
|
|
418
|
+
from palaryn import PalarynClient, Actor
|
|
419
|
+
|
|
420
|
+
palaryn = PalarynClient(
|
|
421
|
+
gateway_url="http://palaryn:3000",
|
|
422
|
+
api_key="key-001",
|
|
423
|
+
default_actor=Actor(type="agent", id="research-agent"),
|
|
424
|
+
default_platform="langgraph",
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
# Instead of direct requests.get():
|
|
428
|
+
def safe_http_tool(url: str, task_id: str) -> dict:
|
|
429
|
+
result = palaryn.http_get(task_id, url)
|
|
430
|
+
if result.status == "blocked":
|
|
431
|
+
return {"error": result.error}
|
|
432
|
+
return result.output
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Workflow Engines (n8n, Temporal, Airflow)
|
|
436
|
+
|
|
437
|
+
**Option A — HTTP Node:** Point the HTTP Request node at `http://palaryn:3000/v1/tool/execute` with a ToolCall JSON body. Route on the `status` field in the response.
|
|
438
|
+
|
|
439
|
+
**Option B — Forward Proxy:** Set `HTTP_PROXY=http://palaryn:3128` on the workflow container. All outbound HTTP flows through Palaryn automatically — zero workflow changes.
|
|
440
|
+
|
|
441
|
+
### LLM Gateways (LiteLLM, Portkey)
|
|
442
|
+
|
|
443
|
+
Palaryn **complements** LLM gateways — it does not replace them:
|
|
444
|
+
|
|
445
|
+
```
|
|
446
|
+
Agent → LLM Gateway (model routing, token budget) → LLM returns tool_call
|
|
447
|
+
→ Orchestrator catches tool_call → Palaryn (policy, DLP, budget) → External API
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
- **LLM Gateway** = control over models (routing, cost, rate limiting on tokens)
|
|
451
|
+
- **Palaryn** = control over tools (policy, DLP, budget on real-world actions)
|
|
452
|
+
|
|
453
|
+
### Mobile & Web Apps (Android, iOS, React, Next.js)
|
|
454
|
+
|
|
455
|
+
Client apps **never connect to Palaryn directly** — the backend mediates. The Palaryn API key stays server-side.
|
|
456
|
+
|
|
457
|
+
```
|
|
458
|
+
┌──────────────┐ HTTPS ┌─────────────────┐ Palaryn SDK ┌──────────┐ ┌──────────────┐
|
|
459
|
+
│ Mobile / Web │ ────────→ │ Your Backend │ ────────────→ │ Palaryn │ ──→ │ External API │
|
|
460
|
+
│ Client │ ←───────── │ (Node/Kotlin) │ ←──────────── │ │ ←── │ │
|
|
461
|
+
└──────────────┘ └─────────────────┘ └──────────┘ └──────────────┘
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### IDE Agents (Claude Code, Cursor)
|
|
465
|
+
|
|
466
|
+
Use the MCP Bridge — zero code changes, just configure the MCP server:
|
|
467
|
+
|
|
468
|
+
```
|
|
469
|
+
┌──────────────┐ stdio JSON-RPC ┌────────────────┐ ┌──────────────┐
|
|
470
|
+
│ Claude Code │ ──────────────────→ │ MCP Bridge │ ──→│ External API │
|
|
471
|
+
│ / Cursor │ ←───────────────── │ (Palaryn) │ ←──│ │
|
|
472
|
+
└──────────────┘ └────────────────┘ └──────────────┘
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
**Hosted (remote MCP server — no local build required):**
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
claude mcp add palaryn --url https://palaryn.com/mcp
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
**Local (stdio MCP server):**
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# Build first
|
|
485
|
+
npm run build
|
|
486
|
+
|
|
487
|
+
# Add as MCP server
|
|
488
|
+
claude mcp add palaryn -- node /absolute/path/to/dist/src/mcp/server.js
|
|
489
|
+
|
|
490
|
+
# Or with a custom policy pack
|
|
491
|
+
claude mcp add palaryn -e POLICY_PACK_PATH=./policy-packs/prod_strict.yaml -- node /absolute/path/to/dist/src/mcp/server.js
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
**Project-level config (`.mcp.json` in project root):**
|
|
495
|
+
|
|
496
|
+
```json
|
|
497
|
+
{
|
|
498
|
+
"mcpServers": {
|
|
499
|
+
"palaryn": {
|
|
500
|
+
"type": "stdio",
|
|
501
|
+
"command": "node",
|
|
502
|
+
"args": ["dist/src/mcp/server.js"],
|
|
503
|
+
"env": {
|
|
504
|
+
"POLICY_PACK_PATH": "./policy-packs/default.yaml"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
**Environment variables for MCP mode:**
|
|
512
|
+
|
|
513
|
+
| Variable | Default | Description |
|
|
514
|
+
|---|---|---|
|
|
515
|
+
| `PALARYN_MCP_WORKSPACE` | `ws-claude-code` | Workspace ID |
|
|
516
|
+
| `PALARYN_MCP_ACTOR` | `claude-code` | Actor ID |
|
|
517
|
+
| `PALARYN_MCP_PLATFORM` | `claude_code` | Platform identifier |
|
|
518
|
+
| `POLICY_PACK_PATH` | `./policy-packs/default.yaml` | Policy pack to enforce |
|
|
519
|
+
|
|
520
|
+
Tools exposed: `http_request`, `http_get`, `http_post` — all routed through the full Palaryn pipeline (policy, DLP, budget, rate limiting).
|
|
521
|
+
|
|
522
|
+
### Kubernetes
|
|
523
|
+
|
|
524
|
+
Three deployment models:
|
|
525
|
+
|
|
526
|
+
**Sidecar proxy (per-pod):** One Palaryn container per agent pod. Agent sets `HTTP_PROXY=http://localhost:3128`. Implicit auth via `PALARYN_WORKSPACE_ID` / `PALARYN_ACTOR_ID` env vars. Zero code changes.
|
|
527
|
+
|
|
528
|
+
**Shared gateway (centralized):** One Palaryn instance, multiple agents with separate API keys and workspaces. Agents use the SDK or Direct API.
|
|
529
|
+
|
|
530
|
+
**Network-enforced:** K8s NetworkPolicy blocks direct egress from agent pods, forcing all traffic through the Palaryn proxy. Agents **cannot** bypass policy enforcement.
|
|
531
|
+
|
|
532
|
+
```yaml
|
|
533
|
+
# Block direct egress — force proxy
|
|
534
|
+
apiVersion: networking.k8s.io/v1
|
|
535
|
+
kind: NetworkPolicy
|
|
536
|
+
spec:
|
|
537
|
+
podSelector:
|
|
538
|
+
matchLabels: { role: agent }
|
|
539
|
+
policyTypes: [Egress]
|
|
540
|
+
egress:
|
|
541
|
+
- to:
|
|
542
|
+
- podSelector:
|
|
543
|
+
matchLabels: { app: palaryn }
|
|
544
|
+
ports:
|
|
545
|
+
- port: 3128
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### Quick Reference
|
|
549
|
+
|
|
550
|
+
| Environment | Method | Code Change |
|
|
551
|
+
|---|---|---|
|
|
552
|
+
| **LangGraph / CrewAI / custom agent** | Python/TS SDK | Minimal — wrapper on tool calls |
|
|
553
|
+
| **n8n / Temporal / Airflow** | HTTP Node → API or `HTTP_PROXY` | Zero (proxy) or URL change (API) |
|
|
554
|
+
| **Claude Code / Cursor** | MCP Bridge | Zero — configure MCP server |
|
|
555
|
+
| **Android / iOS app** | Backend → SDK | Backend mediates |
|
|
556
|
+
| **Web app (React / Next.js)** | API Route → SDK | Backend mediates |
|
|
557
|
+
| **K8s microservices** | Sidecar proxy + NetworkPolicy | Zero — env var + NetworkPolicy |
|
|
558
|
+
| **LLM Gateway (LiteLLM / Portkey)** | SDK in orchestrator | Orchestrator delegates tool calls |
|
|
559
|
+
| **Bare metal / VM** | `HTTP_PROXY` env var | Zero — global env var |
|
|
560
|
+
| **Serverless (Lambda)** | SDK in handler | Minimal — import + wrapper |
|
|
561
|
+
|
|
562
|
+
### Integration Kit
|
|
563
|
+
|
|
564
|
+
| Component | Path | Status |
|
|
565
|
+
|---|---|---|
|
|
566
|
+
| TypeScript SDK | `sdk/typescript/` | Implemented |
|
|
567
|
+
| Python SDK | `sdk/python/` | Implemented (sync + async clients, 102 tests) |
|
|
568
|
+
| Policy Packs | `policy-packs/` | Implemented (3 packs: default, dev, prod) |
|
|
569
|
+
| Usage Examples | `examples/` | Implemented |
|
|
570
|
+
| MCP Bridge | `src/mcp/` | Implemented (stdio + HTTP Streamable transport) |
|
|
571
|
+
| n8n Node | `n8n-node/` | Planned |
|
|
572
|
+
|
|
573
|
+
## Canonical Schemas
|
|
574
|
+
|
|
575
|
+
### ToolCall
|
|
576
|
+
|
|
577
|
+
Every tool call is normalized into a canonical format containing:
|
|
578
|
+
|
|
579
|
+
- **Actor** -- Agent, user, or system identity with display name
|
|
580
|
+
- **Source** -- Platform identifier (e.g., `langgraph`, `claude_code`, `n8n`, `custom`) and session ID
|
|
581
|
+
- **Tool** -- Name, version, and capability level (`read`, `write`, `delete`, `admin`)
|
|
582
|
+
- **Args** -- Tool-specific arguments (method, URL, headers, body, query, etc.)
|
|
583
|
+
- **Constraints** -- Per-call cost limit and timeout
|
|
584
|
+
- **Context** -- Purpose description and classification labels
|
|
585
|
+
|
|
586
|
+
### ToolResult
|
|
587
|
+
|
|
588
|
+
Every response includes:
|
|
589
|
+
|
|
590
|
+
- **Policy decision** -- Allow/deny/transform/require_approval with the matched rule ID and reasons
|
|
591
|
+
- **DLP report** -- Detected items, redactions applied, and severity
|
|
592
|
+
- **Budget report** -- Estimated cost, spent-to-date for the task, and remaining budget
|
|
593
|
+
- **Output** -- The actual tool response (with redactions applied)
|
|
594
|
+
- **Timing** -- Start timestamp and duration in milliseconds
|
|
595
|
+
|
|
596
|
+
### Authentication
|
|
597
|
+
|
|
598
|
+
- **API keys** for quick-start and development
|
|
599
|
+
- **mTLS + JWT** for enterprise deployments
|
|
600
|
+
- **Per-workspace keys** with scoped permissions
|
|
601
|
+
- **Idempotency** via required `tool_call_id` (UUID) for safe retry deduplication
|
|
602
|
+
|
|
603
|
+
## Deployment
|
|
604
|
+
|
|
605
|
+
### Tech Stack
|
|
606
|
+
|
|
607
|
+
| Layer | Technology |
|
|
608
|
+
|---|---|
|
|
609
|
+
| **Gateway** | Node.js / TypeScript with Express 5 |
|
|
610
|
+
| **Policy DSL** | YAML with JSON Schema validation + OPA/Rego engine (remote + local eval) |
|
|
611
|
+
| **Immutable logs** | File-based append-only log + in-memory event store for trace queries |
|
|
612
|
+
| **Storage** | In-memory (dev), PostgreSQL (production), Redis (rate limiting + caching) |
|
|
613
|
+
| **Auth** | API keys + JWT/OIDC + RBAC with role-based permissions |
|
|
614
|
+
| **Observability** | OpenTelemetry tracing (OTLP HTTP exporter) + Prometheus metrics (9 metric types) |
|
|
615
|
+
| **Anomaly detection** | Rolling baseline statistics with z-score anomaly flagging |
|
|
616
|
+
| **MCP** | JSON-RPC 2.0 over stdio bridge + HTTP Streamable transport (`/mcp`) |
|
|
617
|
+
| **SDKs** | TypeScript SDK + Python SDK (sync + async) |
|
|
618
|
+
| **Deployment** | Docker / Docker Compose (Gateway + Redis + Postgres + Jaeger) |
|
|
619
|
+
|
|
620
|
+
### Deployment Models
|
|
621
|
+
|
|
622
|
+
**SaaS (Multi-Tenant)**
|
|
623
|
+
- Kubernetes-based with per-tenant keys and logical isolation
|
|
624
|
+
- Optional dedicated clusters for large customers
|
|
625
|
+
|
|
626
|
+
**Enterprise (Single-Tenant)**
|
|
627
|
+
- Helm chart deployment
|
|
628
|
+
- Bring-your-own storage (PostgreSQL, S3)
|
|
629
|
+
- Private networking with mTLS
|
|
630
|
+
|
|
631
|
+
### Security Hardening
|
|
632
|
+
|
|
633
|
+
- Encryption at rest via KMS
|
|
634
|
+
- mTLS for all executor communication
|
|
635
|
+
- Secret-less deployments using OIDC federation to cloud providers
|
|
636
|
+
- WAF and rate limiting at the edge
|
|
637
|
+
- Configurable data retention policies
|
|
638
|
+
- Non-root Docker container with minimal Alpine image
|
|
639
|
+
|
|
640
|
+
### SLOs
|
|
641
|
+
|
|
642
|
+
- **Latency overhead**: p95 < 50 ms for policy + DLP evaluation (excluding downstream tool latency)
|
|
643
|
+
- **Availability**: 99.9%+
|
|
644
|
+
|
|
645
|
+
### Rollout Strategy
|
|
646
|
+
|
|
647
|
+
1. **Shadow mode** -- Log-only with no blocking for the first week
|
|
648
|
+
2. **Enforce mode** -- Start by denying only high-risk actions
|
|
649
|
+
3. **Full mode** -- Enable approvals, budgets, and transformations
|
|
650
|
+
|
|
651
|
+
## Pricing Tiers
|
|
652
|
+
|
|
653
|
+
| | Free / Dev | Pro | Business | Enterprise |
|
|
654
|
+
|---|---|---|---|---|
|
|
655
|
+
| **Tool calls / month** | 50,000 | 1,000,000 | 10,000,000 | Unlimited / negotiated |
|
|
656
|
+
| **Log retention** | 7 days | 30 days | 180 days | Custom + WORM |
|
|
657
|
+
| **Security** | Basic allowlists + secrets scan | Approvals + budgets + basic anomaly | SIEM export + SSO (SAML/OIDC) + policy packs | Custom policy engine (OPA) + private deployment |
|
|
658
|
+
| **Support** | Community | Standard | Priority | Dedicated + SLAs |
|
|
659
|
+
| **Price** | Free | $99 -- $299 / mo | $999 -- $2,999 / mo | $25,000+ / year |
|
|
660
|
+
|
|
661
|
+
### Add-ons
|
|
662
|
+
|
|
663
|
+
- ClickHouse analytics for high-volume event querying
|
|
664
|
+
- Sandbox replay runner for post-incident investigation
|
|
665
|
+
- Advanced DLP with NER and custom dictionaries
|
|
666
|
+
- Browserless executor for headless browser automation
|
|
667
|
+
|
|
668
|
+
Pricing is usage-based (per tool call) rather than seat-based, directly mapping to the real work agents perform.
|
|
669
|
+
|
|
670
|
+
## Roadmap Highlights
|
|
671
|
+
|
|
672
|
+
### MVP (2-3 weeks)
|
|
673
|
+
|
|
674
|
+
- HTTP executor with domain allowlists and secrets detection
|
|
675
|
+
- Structured audit log with immutable storage
|
|
676
|
+
- Task and workspace budgets
|
|
677
|
+
- Simple web-based approval workflow
|
|
678
|
+
- MCP router and SDK adapters
|
|
679
|
+
|
|
680
|
+
### v1 (6-8 weeks)
|
|
681
|
+
|
|
682
|
+
- PII detection with configurable redaction strategies
|
|
683
|
+
- SIEM export (Splunk, Elastic)
|
|
684
|
+
- Cost and governance dashboard (top spenders, blocked actions)
|
|
685
|
+
- Pre-built policy packs for dev, prod, and ads workflows
|
|
686
|
+
|
|
687
|
+
### v2 (3-6 months)
|
|
688
|
+
|
|
689
|
+
- Anomaly detection v2 with advanced baselines
|
|
690
|
+
- Replay sandbox for post-mortem analysis
|
|
691
|
+
- Additional executors: Git, read-only database, browserless
|
|
692
|
+
- Policy simulator with diff and dry-run capabilities
|
|
693
|
+
|
|
694
|
+
## Documentation
|
|
695
|
+
|
|
696
|
+
The full product documentation is available in the [`docs/`](docs/) directory:
|
|
697
|
+
|
|
698
|
+
| Document | Description |
|
|
699
|
+
|---|---|
|
|
700
|
+
| [00_overview.md](docs/00_overview.md) | Product overview, value proposition, and adoption modes |
|
|
701
|
+
| [01_market_problem.md](docs/01_market_problem.md) | Market problem analysis and target buyers |
|
|
702
|
+
| [02_architecture.md](docs/02_architecture.md) | System architecture, runtime path, and deployment model |
|
|
703
|
+
| [03_core_components.md](docs/03_core_components.md) | Core components: Policy Engine, DLP, Budgeting, Executors, Audit |
|
|
704
|
+
| [04_api_contracts.md](docs/04_api_contracts.md) | Canonical ToolCall/ToolResult schemas and API endpoints |
|
|
705
|
+
| [05_policy_engine.md](docs/05_policy_engine.md) | Policy engine design, decision model, and rule examples |
|
|
706
|
+
| [06_security_dlp.md](docs/06_security_dlp.md) | Security threat model, DLP scanning, redaction, and compliance |
|
|
707
|
+
| [07_cost_budgeting.md](docs/07_cost_budgeting.md) | Cost tracking, budgets, hard stops, and anomaly detection |
|
|
708
|
+
| [08_audit_observability.md](docs/08_audit_observability.md) | Audit log schema, OpenTelemetry, replay, and SIEM export |
|
|
709
|
+
| [09_adapters_integrations.md](docs/09_adapters_integrations.md) | Adapter types and integration kit deliverables |
|
|
710
|
+
| [10_deployment_prod.md](docs/10_deployment_prod.md) | Tech stack, deployment models, security hardening, and SLOs |
|
|
711
|
+
| [11_pricing_packaging.md](docs/11_pricing_packaging.md) | Pricing tiers, add-ons, and packaging strategy |
|
|
712
|
+
| [12_roadmap_gtm.md](docs/12_roadmap_gtm.md) | Roadmap (MVP through v2), GTM strategy, and positioning |
|
|
713
|
+
|
|
714
|
+
---
|
|
715
|
+
|
|
716
|
+
*"Your agents can use tools. Safely."*
|