Skip to main content

Availability

AI Studio UI plugins extend the admin dashboard with custom interfaces using WebComponents. Build rich admin panels, custom dashboards, monitoring tools, and specialized management interfaces that integrate seamlessly with the AI Studio platform using the Unified Plugin SDK.
Looking for AI Portal (end-user) pages? See the AI Portal UI Plugins Guide for building pages visible to AI Portal users, not just admins.

Overview

UI plugins enable you to:
  • Add Custom Pages: Register new routes in the dashboard
  • Extend Sidebar: Add sections, links, and navigation
  • Serve WebComponents: Use any frontend framework (React, Vue, Lit, etc.)
  • Call Service APIs: Access LLMs, tools, datasources, analytics, and more
  • Store Plugin Data: Use built-in key-value storage
  • Define RPC Methods: Create custom backend endpoints
  • Multi-Capability: Combine UI with middleware hooks (PostAuth, Response, Object Hooks, etc.)

Unified SDK Integration

UI plugins use the Unified Plugin SDK (pkg/plugin_sdk) and can combine UI capabilities with other plugin capabilities like PostAuth, Response, or Object Hooks.

Key Features

  • BasePlugin: Convenience struct for lifecycle management
  • UIProvider: Capability for serving UI assets and RPC methods
  • Context Services: Access KV storage, logging, and Studio Services
  • Multi-Capability: Implement multiple interfaces in one plugin
  • Broker Connection: Automatic Service API access for UI interactions

Example: Multi-Capability Plugin

A single plugin can provide both UI and middleware functionality:
Expandable
Example: examples/plugins/studio/llm-rate-limiter-multiphase/ combines UIProvider + PostAuth + Response in one plugin. ##Quick Start

1. Project Structure

2. Create Manifest

server/manifest.json:
Expandable

3. Implement Plugin Server

server/main.go:
Expandable

4. Create WebComponent

ui/webc/dashboard.js:
Expandable

5. Build and Deploy

Expandable

Manifest Structure

Top-Level Fields

Permissions

Expandable

UI Configuration

Expandable

Available UI Slots

  • sidebar.section: Add sidebar section with nested items
  • sidebar.link: Add individual sidebar link
  • settings.section: Add settings page section
  • app.detail.tab: Add tab to app detail page
  • llm.detail.tab: Add tab to LLM detail page

RPC Configuration

RPC calls are automatically routed to your plugin’s HandleCall() method.

Service API Access

The Service API provides 100+ gRPC operations accessible via the SDK:

LLM Operations

Tool Operations

Plugin Operations

KV Storage Operations

App Operations

Analytics Operations

Governed Metadata Web Components

In the Enterprise Edition, the admin console registers two web components for Governed Metadata:
  • <governed-metadata-fields> shows the standard metadata form with live validation. Set the object-type attribute, for example plugin_resource:12:prompts, and the element loads the schema from the admin API. Where the admin API is not available, such as on AI Portal pages, set el.schema to the result of GetResolvedMetadataSchema. The element has the value property, the getValues(), validate(), and setErrors() methods, and the ready, change, and error events.
  • <governed-metadata-badges> shows the AI Portal badges. Set el.items to the display list that GetObjectMetadata returns for the portal visibility.
To save the values, call SetObjectMetadata. Refer to Governed Metadata in the Service API.

Multi-Capability Patterns

UI plugins using the unified SDK can implement multiple capabilities in a single plugin, combining dashboard UI with request/response processing, object validation, or other hooks.

Combining UI + PostAuth

Create a plugin that both displays data and processes requests:
Expandable

Combining UI + Object Hooks

Create a plugin that validates objects and provides an approval dashboard:
Expandable

Combining UI + Response

Monitor and modify responses with a dashboard:
Expandable

Benefits of Multi-Capability Plugins

  1. Unified State: Share data structures between UI and middleware
  2. Single Deployment: One plugin provides multiple features
  3. Consistent Configuration: Single manifest, config, and initialization
  4. Simplified Management: Deploy, update, and monitor as one unit
  5. Rich Dashboards: Display real-time data from middleware hooks

Working Example

See examples/plugins/studio/llm-rate-limiter-multiphase/ for a complete multi-capability plugin that implements:
  • PostAuth: Check rate limits before requests
  • Response: Update counters after responses
  • UI Provider: Dashboard showing rate limit status

Complete Example: Rate Limiting Dashboard

Here’s a complete example showing all features:

Manifest

Expandable

RPC Methods

Expandable

Frontend Frameworks

React

Expandable

Vue

Expandable

Know Which Administrator Called

HandleRPC(method, payload) does not identify the caller. If a plugin needs the caller (for audit trails, “created by” fields, or behavior for each administrator), implement the optional plugin_sdk.UserAwareRPCHandler interface in addition to UIProvider:
When the plugin implements this interface, AI Studio sends admin UI calls (POST /api/v1/plugins/:id/rpc/:method) to HandleRPCWithUser with the authenticated user. Hosts that do not send a caller still use HandleRPC. A plugin can then share one router between its admin UI (pluginAPI) and its AI Portal UI (portalPluginAPI). From v2.2.0, AI Studio checks the permissions in the rbac.rpc_methods block of the manifest before the call reaches the plugin. Refer to Permissions (RBAC) Block.

Hidden Routes

A sidebar route item with "hidden": true is mounted, and you can open it by URL, but the sidebar does not show it. Use hidden routes for detail or editor pages that open from another page.

Best Practices

Security

  • Always validate inputs in RPC methods
  • Use HTTPS for production deployments
  • Sanitize HTML in WebComponents
  • Don’t expose sensitive data in frontend
  • Use CSP headers in manifest

Performance

  • Lazy-load heavy components
  • Cache frequently accessed data
  • Use KV storage for plugin state
  • Minimize Service API calls
  • Bundle and minify assets

User Experience

  • Show loading states
  • Handle errors gracefully
  • Provide feedback for actions
  • Use consistent UI patterns
  • Support dark mode if platform does

Development

  • Use TypeScript for type safety
  • Add proper error handling
  • Log important operations
  • Test with different data scenarios
  • Document RPC methods

Troubleshooting

  • Check manifest syntax (valid JSON)
  • Verify plugin_type is "ai_studio"
  • Ensure load_immediately is true in plugin registration
  • Check logs for initialization errors
  • Verify asset path is correct (leading /)
  • Check browser console for JS errors
  • Ensure custom element is defined
  • Verify mime types are correct
  • Check permission scopes in manifest
  • Verify SDK is initialized (ai_studio_sdk.IsInitialized())
  • Check context has valid authentication
  • Review service API error messages
  • Ensure assets are embedded (//go:embed)
  • Check GetAsset() normalizes paths correctly
  • Verify mime type detection
  • Check asset paths in manifest match filesystem