Loading...
Loading...
Put authentication, rate limiting, IP restrictions, header rules, or a custom response in front of an ngrok endpoint using a Traffic Policy, without changing application code. Covers requiring login (OAuth/OIDC), locking to specific IPs, blocking or denying requests, returning a maintenance page or custom response, and injecting or stripping headers. Use when the user wants to protect, gate, throttle, or add an API-gateway layer to an endpoint. Use when the user says "add auth to my ngrok URL", "require Google login", "rate limit my endpoint", "restrict by IP", "block a path", or "put up a maintenance page".
npx skill4agent add ngrok/skills secure-endpointngrok-setupngrok-engineon_http_request:
- actions:
- type: oauth
config: { provider: google }
- expressions:
- "!actions.ngrok.oauth.identity.email.endsWith('@yourcompany.com')"
actions:
- type: denyngrok-enginengrok-engine/references/auth-actions.mdon_http_request:
- actions:
- type: restrict-ips
config:
enforce: true
allow:
- 203.0.113.4/32
- 198.51.100.0/24restrict-ipsconn.client_ip in [...]'203.0.113.4'203.0.113.4203.0.113.4/32restrict-ipsinon_http_request:
- expressions: ["req.url.path.startsWith('/admin')"]
actions:
- type: deny
config: { status_code: 403 }rate-limitngrok-engineon_http_request:
- actions:
- type: custom-response
config:
status_code: 503
headers: { content-type: text/html }
body: "<html><body><h1>Back soon</h1></body></html>"on_http_request:
- expressions: ["req.url.path == '/healthz'"]
actions:
- type: custom-response
config:
{
status_code: 200,
headers: { content-type: text/plain },
body: "ok",
}add-headersngrok-enginedenycustom-responsengrok-surfacesngrok-enginereceive-webhooks