Identity
OAuth 2.1 with PKCE, OIDC SSO, mTLS and scoped API keys. Each agent gets its own identity and token lifetime.
// 003 / 006Platform · Security
Auth, scoped permissions, rate limits and audit logs on every call, enforced once at the gateway.
The problemWhen every agent holds its own credentials for every server, secrets sprawl across configs, there's no central way to revoke access, and nobody can say which agent called which tool with what arguments.
With PbjPbj becomes the single enforcement point. Agents authenticate to the gateway; upstream secrets never leave it. Every call is checked against policy, rate-limited and written to a tamper-evident audit log before it reaches a server.
OAuth 2.1 with PKCE, OIDC SSO, mTLS and scoped API keys. Each agent gets its own identity and token lifetime.
Allow or deny by agent, tool and argument values. Policies are code, versioned and testable in CI.
Upstream credentials live in Vault, AWS Secrets Manager or encrypted config, injected at call time only.
Rate limits and quotas per key, argument validation against the tool schema, and output redaction for PII.
The agent presents a token; the gateway verifies signature, audience and scopes.
Policy is evaluated against the caller, the tool and its arguments. Denials return a structured MCP error.
The upstream credential for that server is fetched and attached; the agent never sees it.
Caller, tool, arguments hash, decision and latency are appended to the audit log.
Everything is declarative. Check the file into Git, validate it in CI with Pasti Bahagia Jaya config check, and roll it out like any other change.
1policies:2 - name: support-readonly3 subjects: [agent:support-*]4 allow: [github.search_issues, jira.get_issue]5 - name: no-prod-writes6 deny:7 tool: postgres.execute8 when: "args.database == 'prod' && !args.sql.startsWith('SELECT')"9 10rate_limits:11 default: { requests: 600, per: 1m }Give each agent exactly the tools it needs, down to which tables it may query.
Kill a leaked key or a misbehaving agent once at the gateway, not in every server.
Hand auditors a complete record of which agent did what, when and under which policy.