AutoGen + Grantex

Authorization for AutoGen Multi-Agent Systems

Add per-agent scopes at configured AutoGen function boundaries. Wrapped functions enforce required scopes; other functions remain outside the integration.

The Problem

Without Grantex

AutoGen agents in a group chat share credentials. If one agent is compromised or hallucinates, it has access to everything the others can do.

With Grantex

Configured AutoGen agents can present separate scoped JWTs. Protected function wrappers enforce the required scope, and optional audit callbacks record selected calls.

How Grantex Works with AutoGen

Install the integration

npm install @grantex/autogen — wraps AutoGen function maps with authorization.

Register each agent

Create identities with role-specific scopes for each agent in the group.

Scope per conversation

Obtain a role-scoped grant for each agent through the configured authorization flow before the conversation starts.

Agents operate independently

Each agent presents its own JWT. Configured function wrappers verify the grant and required scope before execution.

Trace everything

Add an audit wrapper to attribute selected function calls and outcomes to specific agents.

Quick Start

npm install @grantex/autogen @grantex/sdk
import { createGrantexFunction } from '@grantex/autogen';

const writeCode = createGrantexFunction({
  name: 'write_code',
  description: 'Write code for an approved task',
  parameters: {
    type: 'object',
    properties: { task: { type: 'string' } },
    required: ['task'],
  },
  grantToken: coderToken,
  requiredScope: 'code:write',
  func: async ({ task }) => writeCodeFn(task),
});

const runCode = createGrantexFunction({
  name: 'run_code',
  description: 'Execute approved code',
  parameters: {
    type: 'object',
    properties: { source: { type: 'string' } },
    required: ['source'],
  },
  grantToken: executorToken,
  requiredScope: 'code:execute',
  func: async ({ source }) => runCodeFn(source),
});

const tools = [writeCode.definition, runCode.definition];

Why Grantex for AutoGen

Per-Agent Authorization

Each agent in the AutoGen group gets its own scoped token and identity.

Group Chat Security

Prevent agents from accessing tools outside their role. Enforced at the protocol level.

Conversation Audit Support

Wrap functions to record which agent called which function and with what scope context.

Delegation Support

Agents can delegate narrower scopes to spawned sub-agents with depth tracking.

Function Map Wrapping

Adapter wrapper for AutoGen function maps; integrate it at every protected function boundary.

Central Grant Control

Revoke an agent grant centrally. Local JWT consumers must synchronize revocation state or use short token lifetimes.

Verification, revocation, and audit boundary

This integration enforces authorization only where its wrapper or middleware is installed. Local JWT verification checks signatures and claims after JWKS retrieval; it does not prove current revocation unless the verifier performs an online state check or synchronizes revocation data.

Token verification does not create a consent record or prove that a tool executed. Use the configured authorization flow for grant decisions and add an audit integration at the execution boundary when action records are required.

Ready to secure your AutoGen agents?

Follow the integration guide and verify the package version before deployment. Apache 2.0.