← All Articles

OpenClaw Provider Policy Migration — Plugins Complete Their Takeover

OpenClaw Architecture Plugin SDK March 29, 2026 · Peter Steinberger · View commit →

Author Context

Peter Steinberger is the creator of OpenClaw and has been systematically refactoring the codebase to move provider-specific logic into the plugin system. This commit represents the final push in a multi-week effort to externalize provider policy from the core gateway.

Why This Matters

OpenClaw supports dozens of AI providers — Anthropic, OpenAI, Google, Mistral, Cohere, local models, and many more. Each provider has quirks: different rate limits, authentication flows, feature flags, and error handling. Previously, this provider-specific policy logic lived in the core gateway code.

This architecture had problems:

The plugin architecture inverts this: providers become self-contained packages that register their capabilities, policies, and transport hooks with the gateway at runtime.

What Changed

The commit touches 11 files across multiple packages:

extensions/amazon-bedrock/index.ts
extensions/anthropic-vertex/index.ts
extensions/anthropic-vertex/index.test.ts
extensions/anthropic-vertex/openclaw.plugin.json
extensions/anthropic-vertex/package.json
extensions/anthropic-vertex/provider.contract.test.ts
src/agents/models-config.providers.implicit.ts
src/agents/models-config.providers.policy.ts
src/agents/models-config.providers.policy.test.ts
src/agents/provider-capabilities.ts
src/agents/provider-capabilities.test.ts

Key insight: The Anthropic Vertex extension now has its own openclaw.plugin.json manifest and contract tests — it's a fully independent package that can be versioned, tested, and published separately from the core gateway.

The coordinated commits on the same day tell the full story:

Technical Details

The refactor introduces a generalized transport hooks pattern. Instead of hardcoded provider checks:

// Before: hardcoded in gateway
if (provider === 'anthropic-vertex') {
  request.headers['X-Vertex-Region'] = config.region;
}

Plugins now register transport hooks that the gateway invokes:

// After: in anthropic-vertex plugin
export const transportHooks = {
  beforeRequest: (ctx) => {
    ctx.headers['X-Vertex-Region'] = ctx.config.region;
  }
};

This pattern extends to rate limiting, retry logic, error mapping, and capability discovery — all now delegated to plugins.

Implications

For users: Nothing changes. The same providers work the same way. But future provider additions and updates will ship faster and break less.

For contributors: Adding a new provider no longer requires understanding the gateway internals. Create a plugin package, implement the required interfaces, write contract tests, and submit a PR.

For enterprise: Custom provider plugins become practical. Organizations can add internal model endpoints, custom authentication flows, or specialized rate limiting without forking the gateway.

Next Steps

With provider policy fully externalized, the plugin SDK is now feature-complete for transport-layer integrations. Expect documentation updates and potentially a "create your own provider" guide in the coming weeks.

The version bump to 2026.3.29 in the same batch of commits signals this is considered a stable milestone — the plugin architecture is ready for production use.