Skip to main content

Availability

Tyk AI Studio supports three plugin deployment methods: local filesystem (file://), remote gRPC (grpc://), and OCI registry (oci://). Choose the deployment method based on your environment and requirements.

Deployment Methods Comparison

file:// - Local Filesystem

Deploy plugins from the local filesystem.
Safety settings: By default, local filesystem plugin loading has safety restrictions that prevent loading from arbitrary paths. For development, you may need to adjust these settings in your configuration to allow local path loading and absolute paths. See the Security Considerations section below for details on ALLOW_INTERNAL_NETWORK_ACCESS and PLUGIN_COMMAND_ALLOWLIST.

Building Your Plugin

Creating Plugin via API

Important: Use absolute paths with file://:

Docker Deployment

When deploying with Docker, mount plugins into the container:
Then register with container path:

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

By default, plugins cannot access internal networks. For development:
For production, use allowlist:

Load Balancing

Use Kubernetes services for load balancing:
Register with service DNS:

oci:// - OCI Registry

Deploy plugins as OCI artifacts in container registries.

Prerequisites

  • Docker or Podman
  • OCI-compatible registry (Docker Hub, GHCR, ECR, GCR, Harbor, etc.)
  • Registry credentials configured

Packaging Plugin as OCI Artifact

Create a simple OCI image:
Build and push:

Registering OCI Plugin

Registry Authentication

OCI registry authentication is configured via environment variables using the pattern:
Where <REGISTRY_NAME> is the registry hostname with dots replaced by underscores (e.g., docker.tyk.ioDOCKER_TYK_IO).

Authentication Methods

Entitlement Token (Cloudsmith and similar registries):
Username + Password:
OAuth2/Bearer Token:

AI Studio vs Edge Gateway

Both runtimes use the same OCI_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.

Signature Verification

When signature verification is enabled (Enterprise Edition), the cosign tool verifies plugin signatures against the registry. Cosign uses the standard Docker credential store (~/.docker/config.json) for registry authentication — it does not use the OCI_PLUGINS_REGISTRY_* environment variables. To configure cosign auth in containerized environments:
For Kubernetes, mount a Docker config secret:
Configure public keys for signature verification:

Cloudsmith-Specific Notes

When using Cloudsmith with a custom Docker domain (e.g., docker.tyk.io):
  • Entitlement auth is the recommended method for programmatic access
  • Entitlements bypass the Docker token exchange, which avoids scope issues with Cloudsmith’s namespace-level scope requirements
  • Each Cloudsmith repository has its own entitlement tokens — use repository-level entitlements
  • The ENTITLEMENT auth type sends Basic auth directly on every request, which Cloudsmith supports natively

Version Management

Use tags for version management:

Caching

OCI plugins are pulled and cached locally:

Security Considerations

Command Validation

The platform validates plugin commands for security:
  1. Absolute Paths: file:// commands must use absolute paths
  2. Internal Network Block: By default, grpc:// commands cannot target internal IPs (10.x.x.x, 172.16-31.x.x, 192.168.x.x, 127.x.x.x, localhost)
  3. Allowlist: Configure allowed commands via PLUGIN_COMMAND_ALLOWLIST
Example warnings:

Production Security

For production deployments:
  1. Disable Internal Network Access:
  2. Use Allowlist:
  3. Use OCI with Signed Images:
    • Sign images with Cosign or Notary
    • Verify signatures before deployment
    • Use content trust
  4. Principle of Least Privilege:
    • Run plugins with minimal permissions
    • Use read-only filesystems where possible
    • Implement network policies in Kubernetes

Troubleshooting

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://
  • Review plugin logs for initialization errors
Symptoms: “Permission denied” error when loading pluginSolutions:
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)
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
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

  1. Local Development: Use file:// for fast iteration
  2. Reload Loop: Use POST /api/v1/plugins/{id}/reload to test changes instantly
  3. Testing: Deploy to staging with grpc:// or oci://
  4. Production: Use oci:// with versioned tags
See Plugin Development Workflow for detailed setup, helper scripts, and the fastest development loop.

Version Management

  1. Use semantic versioning
  2. Tag releases in Git and OCI registry
  3. Never reuse tags (immutable releases)
  4. 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