The Simplest Way to Make Cypress and Kuma Work Like They Should
Teams use cypress and kuma together to run browser tests across a service mesh. Cypress runs end-to-end checks on the web app, while Kuma routes traffic between backend services. This setup lets developers test real service rules before code reaches users. You can check traffic splits, timeouts, and fault rules during a standard test run. Both tools need clear network paths and tight access rules to work well. How cypress and kuma share access and traffic Cypress runs outside the mesh or ins
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use cypress and kuma together to run browser tests across a service mesh. Cypress runs end-to-end checks on the web app, while Kuma routes traffic between backend services.
This setup lets developers test real service rules before code reaches users. You can check traffic splits, timeouts, and fault rules during a standard test run. Both tools need clear network paths and tight access rules to work well.
How cypress and kuma share access and traffic
Cypress runs outside the mesh or inside a test pod as a browser client. It sends web requests to the front door of your app. From there, Kuma takes over and routes each call between internal services.
Kuma uses sidecar proxies next to each service to check identity and apply rules. When Cypress starts a test, it logs in to the app with test keys. The app then talks to backend services through the Kuma data plane.
Sometimes Cypress also talks to the Kuma control plane API to check mesh state. For example, a test might read mesh rules or seed test state before a run. To do this safely, the test runner needs its own scoped token.
Data flows in two clear paths during each test job. First, browser traffic goes to the web app and through the mesh sidecars. Second, setup calls go from the test runner to the backend APIs or data stores.
Common failure modes and how to scope roles
Many teams hit trouble when they share one admin key across all test runners. If a build log leaks that key, anyone can change mesh rules. Broad tokens also let a broken test script wipe out shared staging services.
Another common issue is unlogged setup queries during test runs. Cypress tests often call backend databases or APIs to set up test users. When these calls use a shared account, teams cannot trace which test broke the data.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Network timeouts also cause flaky tests when mesh rules block the test runner. Kuma might drop traffic if mutual TLS is on and the test pod lacks a cert. Teams often turn off security checks to fix this, which creates risk.
To fix these problems, give your Cypress runner a narrow role with read-only mesh permissions. Create separate service accounts for each test stage so logs show exact actors. Scope network rules in Kuma so test traffic only reaches the services under test.
Testing mesh traffic rules with browser checks
Once access is scoped, you can verify mesh behavior from the user view. Kuma lets you set up fault injection, rate limits, and circuit breakers. Cypress then checks how the front end handles those backend delays or errors.
For example, Kuma can add a brief delay to a payment service call. Cypress then checks that the web page shows a clean loading state. This proves your app handles real network slowdowns without crashing the user screen.
Keep test data clean when you run these checks in shared stages. If tests read user records, mask sensitive fields like emails, phone numbers, and card numbers. Masking rewrites matched fields in results so test logs stay safe to share.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Should Cypress run inside or outside the Kuma mesh?
Run Cypress outside the mesh if you want to test the real user path. Run it inside the mesh only when you test internal apps that lack public ingress.
How do we stop Kuma mutual TLS from breaking Cypress API calls?
Route Cypress requests through your standard ingress point instead of calling sidecars directly. If the runner must sit inside the mesh, assign a valid data plane proxy to it.
How should Cypress manage test data across services in Kuma?
Use dedicated setup endpoints or scoped database roles for each test run. Avoid using the Kuma control plane token to change app data, and rotate test keys often.
Related guides
In this post