iii-worker-manager
What it does
Sets up the listener that workers use to connect to an iii engine, and controls which functions each connection can use. It is for developers exposing an iii engine to other workers or networks who need access control.
When to use it
- ✓When you want workers on another network to connect to your engine safely.
- ✓When you need to limit which functions a connected worker can call.
- ✓When you want to log or rate-limit every call that passes through the engine.
Skill link
https://github.com/iii-hq/iii/blob/main/engine/src/workers/worker/skills/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Expose my iii engine to an untrusted network, with access rules that limit what each connected worker can call.”
5 new skills a week. 1 minute to read.
How it works
The skill configures WebSocket listeners on separate ports, each with its own access rules. Access checks run for each connection, and an optional middleware function can audit, rate-limit or change each call before it reaches its target.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
iii-worker-manager
The iii-worker-manager is a mandatory engine worker that opens WebSocket listeners. The base
engine.workers.iii-worker-manager entry sets the main port (49134 by default); #instance
entries open separate listeners with their own RBAC, middleware, and registration hooks. Channels
are mounted on every listener at /ws/channels/{channel_id}.
When to Use
- Exposing the engine to an untrusted network — RBAC is mandatory, never open the engine port itself. Use the standalone
rbac-proxyworker (iii trigger compose::add worker=rbac-proxy), which applies these RBAC rules on its own port out of process. A second#instancelistener with anrbacblock and anauth_function_idis the in-engine alternative. - Restricting which functions a connected worker can invoke — combine
expose_functionsfilters (operator-side) withforbidden_functionsfromAuthResult(per-session, hard deny). - Auditing, rate-limiting, or enriching every invocation — set
middleware_function_idon the listener; the middleware decides whether to call the target and what to return. - Per-tenant or per-session namespace isolation — return
function_registration_prefixfrom the auth function so every function/trigger this session registers is transparently prefixed without the worker code knowing. - Gating dynamic registration — wire
on_function_registration_function_id,on_trigger_registration_function_id, oron_trigger_type_registration_function_idto validate or rewrite registrations.
Boundaries
- The infrastructure carve-out (
engine::channels::create,engine::workers::register,engine::log::*,engine::baggage::*) is always allowed on RBAC listeners regardless ofexpose_functions. Adding one of those IDs toforbidden_functionsdenies it but logs a warning — workers may behave unpredictably (broken setup, lost logs, missing context). - The engine port must remain internal. Only
rbac-proxyor an RBAC-protected#instancelistener may face an external network. - The middleware is not a pre-handler — it must invoke the target function itself (typically via
iii.trigger) and return its result. Returning early without invoking simply skips the call. forbidden_functionsfrom the auth result wins over bothallowed_functionsandexpose_functions. There is no way for a session to override an operator's deny list.- Registration hooks return mapped fields or throw to deny. Omitted result fields keep their original values; returning
{}is a no-op (allow as-is). - Triggers and functions registered through an RBAC session are scoped to that session and cleaned up automatically on disconnect.
Configuration
Two listeners — one internal, one external with in-engine RBAC (the rbac-proxy worker accepts the same rbac block through the configuration worker instead):
engine:
workers:
iii-worker-manager:
port: 49134
"iii-worker-manager#rbac":
host: 0.0.0.0
port: 49135
middleware_function_id: my-project::middleware
rbac:
auth_function_id: my-project::auth
on_function_registration_function_id: my-project::on-fn-reg
on_trigger_registration_function_id: my-project::on-trig-reg
on_trigger_type_registration_function_id: my-project::on-trig-type-reg
expose_functions:
- match("api::*")
- match("*::public")
- metadata:
public: true
Auth function
Receives AuthInput { headers, query_params, ip_address }, returns AuthResult. Throw to reject the connection.
import type { AuthInput, AuthResult } from '@iii-dev/helpers/worker-connection-manager'
iii.registerFunction(
'my-project::auth',
async (input: AuthInput): Promise<AuthResult> => {
const token = input.headers?.['authorization']?.replace(/^Bearer\s+/i, '')
if (!token) throw new Error('Missing credentials')
const user = await validateToken(token)
return {
allowed_functions: [],
forbidden_functions: user.role === 'readonly'
? ['api::users::delete', 'api::users::update']
: [],
allowed_trigger_types: user.role === 'admin' ? ['cron', 'webhook'] : undefined,
allow_trigger_type_registration: user.role === 'admin',
function_registration_prefix: `tenant-${user.tenant_id}`,
context: { user_id: user.id, role: user.role, tenant_id: user.tenant_id },
}
},
)
`A
FAQ
Should I open the engine port directly to the internet?
No. Access rules are required for untrusted networks, and a separate proxy worker is the recommended way to enforce them.
Can each customer get a separate namespace?
Yes. An auth function can add a prefix to every function and trigger a session registers, which isolates each tenant.
What does the middleware do?
It sees every invocation on its listener and decides whether to pass the call on and what to return.
Details
Original description by the author
WebSocket listener that SDK workers connect to. Use to expose the engine to trusted (internal) and untrusted (RBAC-protected) workers, gate function and trigger registration, and audit or transform every invocation through a middleware function. Mounts channel WebSocket endpoints on every listener.
repo: iii-hq/iii
Popularity
- GitHub stars
- 19k
- Ranking position
- #10490
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
iii-sandbox
19kHelps your agent run untrusted or AI-generated code safely inside a temporary isolated virtual machine, then discard it when finished.
configuration
19kLets your agent set up a shared registry of named configuration values, checked against a schema, so workers can read and react to changes.
iii
19kTeaches your agent how iii workers work, so it can add a capability by first checking what already exists, then building a worker.
iii-observability
19kHelps your agent add tracing, structured logs, metrics and alerts to an iii engine, using OpenTelemetry so you can see what is happening.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.