Embedding Securely: Where the Real Security Boundary Is in ByteChef Embedded ByteChef published a security breakdown of its Embedded automation platform, sorting controls into what the server enforces, what the UI only hides, and what integrators must configure themselves. The writeup details JWT-based connected-user auth with RSA-2048 signing keys and short TTLs, path-scoped external user IDs, per-environment isolation via the X-Environment header, and frame-ancestors CSP gated by BYTECHEF_EMBEDDED_ALLOWED_PARENT_ORIGINS. It also notes that rate limiting is left entirely to the integrator's ingress. You've wired an automation platform into your SaaS: iframes in your UI, signed tokens in the browser, backend API calls, and an MCP endpoint for AI agents. Every one of those is a door into your customers' data. So where exactly is the lock? This post walks through the security boundary of ByteChef Embedded https://www.bytechef.io and sorts every control into three buckets: what the server enforces , what the UI only hides , and what's left to you . The good news: most of it is on by default. You have two settings to flip and a handful of sample-app shortcuts to fix before real users show up. sub as the user. BYTECHEF EMBEDDED ALLOWED PARENT ORIGINS so only your app can frame the embedded pages. BYTECHEF AUDIT ENABLED=true . | Layer | Enforced by | You configure | |---|---|---| | Who the user is | JWT signature vs. your Signing Key | One key per environment, short TTL | | Whose data | sub must match the path; frontend endpoints read the user from the token | Nothing | | Which environment | Keys, users and MCP servers each belong to one | X-Environment header, optional environmentId claim | | Who can frame the UI | frame-ancestors CSP + origin-checked handshake | BYTECHEF EMBEDDED ALLOWED PARENT ORIGINS | | Admin operations | Tenant-admin check on every call | Who gets the admin role | | What an agent can call | Server-wide and per-user MCP tool switches | Your MCP servers | | Credentials at rest | AES-GCM encryption | Encryption key provider | | Evidence | Audit events | bytechef.audit.enabled | | Volume | Nothing | Rate limits at your ingress | Your users never get ByteChef accounts. Your backend vouches for them with a signed JWT, and ByteChef trusts the signature, not the browser. Create a key under Embedded → Settings → Signing Keys . ByteChef generates an RSA-2048 pair, stores the public half with a Key Id your kid , and shows you the private key once . Lose it and you create a new one. Minting a token on your backend looks like this: python import jwt from 'jsonwebtoken'; export function signConnectedUserToken userId: string : string { return jwt.sign { sub: userId, // your user's stable id environmentId: 2, // optional: pin to PRODUCTION connectionDialogAllowed: true, // optional: may they create connections? }, process.env.BYTECHEF PRIVATE KEY , { algorithm: 'RS256', expiresIn: '10m', keyid: process.env.BYTECHEF KID } ; } What ByteChef checks before any endpoint runs: kid 401 . exp environmentId name , email , anything else PATCH call. If the check itself can't run say, the database is down , you get a 503 , never a silent pass. Rotation is deliberately boring: create a new key, deploy it, delete the old one. With a 10-minute TTL and a frontend that refreshes on 401 , nobody notices. | | Connected-user JWT | Embedded API Key | |---|---|---| | Lives in | The browser, for minutes | Your backend | | Used on | /automation/workflows , /connections , ... | /{externalUserId}/automation/workflows , ... | | The user is | The token's sub | The path segment | Two rules make this safe: {externalUserId} , it's a 1234 can't touch user 5678 . Every request lives in exactly one environment, picked by the X-Environment header. No header means PRODUCTION . User 1234 in Development and user 1234 in Production are two different users with different connections and workflows. This also explains the most confusing 401 in development: a token signed with a Development key, sent without the header, gets checked against Production keys. The workflow builder, Automation Hub and Integration Marketplace render in your product as iframes. Left open, any site could frame them, which is exactly what clickjacking needs. BYTECHEF EMBEDDED ALLOWED PARENT ORIGINS=https://app.example.com,https://admin.example.com Once set and the server restarted , those pages send Content-Security-Policy: frame-ancestors ... and accept their init message only from the listed origins. Everything else in the ByteChef UI sends X-Frame-Options: DENY regardless. Gotcha: use exact origins, no wildcards. A browser would accept https:// .example.com in frame-ancestors , but the handshake compares origins exactly, so the page renders and then never initializes. With the list empty, every embedded page logs a console warning. Production shouldn't show it. The iframe posts EMBED READY only to allowed origins and accepts EMBED INIT only from its direct parent. On your side, the @bytechef/embedded components only talk to the origin of the baseUrl you passed. The JWT rides inside EMBED INIT , never in the URL , so it stays out of history, Referer headers and access logs, and it's kept in memory, never in local storage. This is the table to remember when someone opens devtools: | Control | Server-enforced? | |---|---| | connectionDialogAllowed claim | ✅ false means creating a connection is a 403 | | connectionDialogAllowed prop | Only as a restriction; it can't grant what the token denies | | includeComponents , tabs , editWorkflowAllowed | ❌ UI only | | Enabled integration configurations | ✅ | | Shared connections | ✅ only the owner can reconnect or delete | | Permission expressions | Evaluated server-side, but on data the user can edit | That last row bites people. A user holding their own JWT can PATCH /api/embedded/v1/me and change their own name, email and metadata. So metadata.plan == 'enterprise' is fine for tidying a catalog and useless for protecting anything. Restrict real features with things the user can't edit: which configurations you enable, which tokens you mint, what your backend allows. Embedded auth is a bearer header, never a cookie, so there's nothing for CSRF to ride on and no server session to hijack. Many embedded endpoints allow cross-origin calls from anywhere, and that's fine: CORS isn't access control, the token is. The admin UI does use a session cookie and keeps its XSRF protection. Well over a hundred embedded admin operations integrations, MCP servers, connected users, Signing Keys... require ROLE ADMIN . A connected user's token carries no roles, so it can never pass that check. Keep the admin group small: any admin can manage every key in the environment. The embedded MCP URL looks like https://