Availability
Signature verification of OCI plugins needs the Enterprise Edition.
Tyk AI Studio supports three plugin deployment methods: local filesystem (
file://), remote gRPC (grpc://), and OCI registry (oci://).
Deployment Methods Comparison
An administrator can turn off a deployment method. Set
AI_STUDIO_PLUGIN_ALLOWED_SOURCES on AI Studio and PLUGINS_ALLOWED_SOURCES on each Edge Gateway. Refer to Restrict Plugin Sources.
file:// - Local Filesystem
Deploy plugins from the local filesystem.Building Your Plugin
Creating Plugin via API
file://:
Docker Deployment
When deploying with Docker, mount plugins into the container:Kubernetes Deployment
Mount plugins via ConfigMap or PersistentVolume:Expandable
grpc:// - Remote gRPC
Deploy plugins as remote gRPC services.Running Plugin as gRPC Server
Your plugin already implements gRPC via go-plugin. To run it as a remote service, you need a gRPC wrapper:Expandable
Deploying with Docker
Register Remote Plugin
Network Configuration
Internal Network Access
From Tyk AI Studio 2.3.0, AI Studio and the Edge Gateway refuse agrpc:// plugin at an internal address. Examples are a private IP address or a cluster-internal service name. To allow one host, turn on Allow internal host on the plugin, or add the host to LLM_UPSTREAM_ALLOWED_INTERNAL_HOSTS. Refer to Internal Registries and Hosts.
Load Balancing
Use Kubernetes services for load balancing:oci:// - OCI Registry
Deploy plugins as OCI artifacts in container registries.Prerequisites
- Docker or Podman
- OCI-compatible registry, such as Docker Hub, GHCR, ECR, GCR, or Harbor
- Registry credentials configured
Packaging Plugin as OCI Artifact
AI Studio reads the first layer of the artifact as the plugin binary. Push the binary with ORAS. Do not push it as a Docker image. For the commands, signing, and marketplace listing, refer to Publish Plugins.Registering OCI Plugin
Registry Authentication
Set OCI registry authentication with environment variables of this pattern:<REGISTRY_NAME> is the registry hostname with dots changed to underscores. For example, docker.tyk.io becomes DOCKER_TYK_IO.
Authentication Methods
Entitlement Token (Cloudsmith and similar registries):AI Studio vs Edge Gateway
Both runtimes use the sameOCI_PLUGINS_REGISTRY_* environment variables for auth. The difference is in how OCI support is enabled:
Important:
AI_STUDIO_OCI_CACHE_DIR must be set for OCI plugin support to be enabled in AI Studio. Without it, OCI plugins cannot be installed or loaded, and registry auth configuration is ignored.
Plugin Size Limit
AI Studio and the Edge Gateway stream plugin layers directly from the registry. To change the maximum layer size, set AI_STUDIO_OCI_MAX_PLUGIN_SIZE on AI Studio or OCI_PLUGINS_MAX_PLUGIN_SIZE on the Edge Gateway.Signature Verification
From Tyk AI Studio 2.3.0, AI Studio and the Edge Gateway require a valid signature on each OCI plugin by default (Enterprise Edition). The Helm charts also require signatures by default. For the signature settings, the public keys, and how to load unsigned plugins during development, refer to Signature Verification. To sign a plugin, refer to Sign the Plugin.Cloudsmith-Specific Notes
For Cloudsmith with a custom Docker domain, such asdocker.tyk.io, use entitlement auth:
- Entitlements bypass the Docker token exchange. This avoids scope issues with the namespace-level scope requirements of Cloudsmith.
- Each Cloudsmith repository has its own entitlement tokens. Use repository-level entitlements.
- The
ENTITLEMENTauth type sends Basic auth directly on every request, which Cloudsmith supports natively.
Version Management
Use tags for version management:Caching
AI Studio and the Edge Gateway pull OCI plugins and cache them locally:Security Considerations
Plugins run as separate processes with the privileges of the host. Install only plugins that you trust. For the complete security model, refer to Plugin Security.Command Validation
The platform validates plugin commands:- Absolute Paths:
file://commands must use absolute paths. The path must be in an allowed directory (AI_STUDIO_PLUGIN_ALLOWED_DIRS). - Internal Hosts: Refer to Internal Network Access. PLUGIN_BLOCK_INTERNAL_URLS is deprecated.
- Allowlist: PLUGIN_COMMAND_ALLOWLIST is advisory. The host logs a warning for a command that does not match it, but it still accepts the command. Its entries are comma-separated substrings.
Production Security
Follow the Production Checklist. For an example configuration, refer to Restrict Plugin Sources.Plugin Process Environment
From Tyk AI Studio 2.3.0,file:// and oci:// plugins do not inherit the environment of their host. They get only an allowlist of variables. To pass more host variables, set PLUGIN_ENV_PASSTHROUGH. Refer to Plugin Environment.
The GitHub RAG ingest plugin reads GITHUB_RAG_SECRET_ENCRYPTION_KEY and GITHUB_RAG_KNOWN_HOSTS from its environment.
- If you set either variable, add
GITHUB_RAG_*toPLUGIN_ENV_PASSTHROUGHbefore you upgrade. As an alternative, setsecret_encryption_keyandknown_hosts_pathin the plugin configuration. - Without the key, repositories with encrypted credentials do not sync, and the plugin stores new credentials unencrypted.
Plugin Message Size
The host and the plugin exchange each hook call as one gRPC message. The message holds the body, the headers and the context. From Tyk AI Studio 2.3.0, plugins built on the 2.3.0 SDK accept the host limit. Set the limit on the host with PLUGIN_GRPC_MAX_MSG_BYTES on AI Studio or PLUGIN_GRPC_MAX_MSG_BYTES on the Edge Gateway. The host passes it to each plugin that it starts. On an Edge Gateway LLM withpre_auth, auth or post_auth plugins, the gateway refuses a request body over this limit with 413.
A plugin built on an SDK before 2.3.0 accepts only 4 MiB. When such a plugin refuses a larger message:
- For
pre_auth,authandpost_authplugins, the gateway returns413withrequest too large for the gateway's plugins (<bytes> bytes). It does not forward the request. The log names the plugin. - For response plugins, the gateway sends the response without the changes of that plugin. It logs the plugin name and the size.
grpc:// plugin sets its own server limit.
Calls from a plugin to the Service API are limited to 8 MiB for each message.
Troubleshooting
Plugin Not Loading
Plugin Not Loading
Symptoms: Plugin shows as inactive, errors in logsSolutions:
- Verify plugin binary has execute permissions (
chmod +x) - Check absolute path is correct for
file:// - Verify network connectivity for
grpc:// - Check registry authentication for
oci:// - Check that the plugin is signed and that its key is configured, for
oci://(Enterprise Edition) - Check that
AI_STUDIO_PLUGIN_ALLOWED_SOURCESorPLUGINS_ALLOWED_SOURCESallows the source - Look for log lines that start with
plugin host "<host>" is an internal address - Review plugin logs for initialization errors
503 with the error code plugin_load_failed. Refer to When a Plugin Cannot Be Loaded.Large Requests Return 413
Large Requests Return 413
Symptoms: Requests with large bodies, such as screenshots or PDF documents, fail with
413 and request too large for the gateway's pluginsSolutions:- Rebuild the plugins of the LLM on the 2.3.0 SDK. The log names the plugin.
- Upgrade the shipped plugins to their 2.3.0 releases.
- Check
PLUGIN_GRPC_MAX_MSG_BYTES. Refer to Plugin Message Size.
Permission Denied
Permission Denied
Symptoms: “Permission denied” error when loading pluginSolutions:
Network Connection Errors
Network Connection Errors
Symptoms: “connection refused”, “no route to host” for
grpc://Solutions:- Verify plugin server is running:
telnet plugin-host 50051 - Check firewall rules
- Verify Kubernetes service is created
- Check DNS resolution
- Enable internal network access if needed (development only)
OCI Pull Failures
OCI Pull Failures
Symptoms: “Failed to pull image”, “authentication required”Solutions:
- Verify registry URL is correct
- Check credentials are configured
- Test manual pull:
docker pull registry.example.com/plugins/my-plugin:v1.0.0 - Check registry permissions
- Verify image exists with correct tag
Plugin Crashes on Start
Plugin Crashes on Start
Symptoms: Plugin loads but immediately crashesSolutions:
- Check plugin logs for panics
- Verify Go version compatibility
- Check for missing dependencies
- Test plugin standalone:
./my-plugin - Review initialization code for errors
Best Practices
Development Workflow
- Local Development: Use
file://for fast iteration - Reload Loop: Use
POST /api/v1/plugins/{id}/reloadto test changes instantly - Testing: Deploy to staging with
grpc://oroci:// - Production: Use
oci://with versioned tags
Versioning Rules
- Use semantic versioning
- Tag releases in Git and OCI registry
- Never reuse tags (immutable releases)
- Document breaking changes
Deployment Pipeline
Expandable
Monitoring
- Monitor plugin health via
/api/v1/plugins/{id}/health - Track plugin performance metrics
- Set up alerts for plugin failures
- Log all plugin operations