Backend and identity engineer

Rajatendu Dey

I build distributed backend systems, authentication and identity infrastructure, and AI-powered applications. Most recently SDE II on the AWS UnifiedAuth platform; previously an engineer at HSBC, with an earlier machine learning internship at HighRadius.

Hooghly, India · Open to Bangalore and remote roles

Every entry ships with an evidence summary: tests, measured results and a live demo where one exists. Public source: llmgate and Actas.

Project 01 · LLM infrastructure

llmgate

Live demo

An OpenAI-compatible API gateway in Python and FastAPI: routing, failover, streaming, per-key rate limits and usage metering, deployed live.

One reliable front door for AI models: when a provider slows down or fails safely, the app behind it keeps answering on a backup. Ambiguous failures are surfaced, never silently retried.

Client POST /v1/chat/completions llmgate · admission Key auth + rate limit Redis · atomic Lua take · 429 + Retry-After Router priority tiers · weighted routing circuit breaker per provider healthy failover Provider A primary Provider B backup · simulated response Usage metering usage settles after the response requests · tokens · est. cost per key real Groq primary + backup in the demo; failover exercise stays simulated
The request path as implemented. Bounded retries only for classified retryable failures; the live demo exercises availability-first failover against simulated upstreams, while explicit buttons call real Groq models alongside the default simulated Try.
Try the live demo

One click sends a request through the gateway and shows the route it took; another hands work to a sub-agent and shows it being refused a model outside its permissions. Or mint a 24-hour key and call the gateway from your own OpenAI-compatible client - Python and Node quickstarts included; minted keys reach the simulated fleet only.

The engineering

  • One /v1/chat/completions endpoint in front of several providers, with priority tiers, weighted routing and a circuit breaker per provider.
  • Retries classified by generation risk: bounded same-provider retries with backoff only for classified retryable failures (connect-phase failure, or a 429 treated as rejected at admission, a documented policy assumption rather than a provider guarantee).
  • Ambiguous failures (timeouts, 5xx, mid-stream) are never retried in place; failover after them is duplicate-averse by default. The live demo exercises availability-first failover against simulated upstreams; explicit real-model buttons call live Groq models (a primary and a direct-call backup) next to the default simulated Try, with real failover verified locally against fault injection, not an actual outage.
  • Delegation built in: an embedded Actas token exchange (RFC 8693) narrows a user token down a chain of agents - the sub-agent reaches the plain simulated model but is refused the expensive one with 403 insufficient_scope, a scope-widening attempt is rejected at the exchange, and every grant and denial lands in a hash-chained audit log whose integrity is verified before the result renders.
  • Measured stage timings: every response carries a standard Server-Timing header with measured spans - authentication, admission (limiter, scope, token bucket), routing (candidate order, breaker, retry backoff), the provider call (time to first chunk for streams) and usage metering. The demo shows these real per-request measurements against each stage of the request journey; the flow animation stays illustrative and is labelled as such. Per request at 0.1 ms granularity, a view of one request rather than a benchmark: streamed responses carry pre-body spans only, and a refusal stops at the refusing stage.
  • Per-key request and token rate limits on shared Redis, one atomic Lua call per take, with 429 and Retry-After; fail-closed if the store is down.
  • API keys hashed at rest and rotated live; Prometheus metrics, request IDs, security headers and a dependency-aware readiness probe.

276 rps

Healthy, non-stream

p99 364 ms · 4,000 req · all 200

248 rps

Healthy, streaming

p99 395 ms · 2,000 req · all 200

575 rps

Primary fails 30%

all 200 · backup served 1,265

588 rps

Primary fully down

all 200 · every call via backup

Historical local load-test results recorded 9 Nov 2026 against simulated providers, 32 clients. Not rerun against the current build; a sanity check, not a capacity claim.

Verification
Historical result recorded 9 Nov 2026: 162 unit, API and integration tests, 61 end-to-end shell checks and a 23-check JS smoke gate; real-model and delegation demo checks were recorded that day. Current checks and results are in the public repository.
Stack
Python, FastAPI, Redis (Upstash), Vercel serverless, Docker packaging

Honest limits

The deployment can configure real Groq routes; configuration does not establish current provider availability or pricing. Historical demo measurements recorded 9 Nov 2026 follow, not measurements of the current build. The default Try button is simulated; the real-model button on the primary is verified at 78 prompt + 16 completion tokens in about 415 ms; a direct backup button (a direct call, not failover) returned 78 + 19 tokens in about 180 ms, and both real buttons share one global budget. Real failover is verified only locally: a fault-injected dead primary was retried once, then the real backup answered (78 + 14 tokens, 504 ms) - not an actual provider outage, and independent-vendor failover remains open. The benchmarks and the failover load exercise remain simulated. The real buttons are rate-limited (about one request per 100 seconds, small bursts; a 429 means it is recharging). The delegation demo embeds the issuer inside the gateway process (one trust domain: no remote issuer or JWKS) and uses explicitly unbound bearer tokens - proof-bound (cnf) tokens are rejected rather than downgraded, and each run issues and consumes its own tokens; model allowlists and budgets come from server configuration, never from token claims. It demonstrates delegation semantics and least-privilege enforcement, not production authorization. Breaker and latency state is per instance. Runs on Vercel Hobby (personal, non-commercial); the Redis plan is unverified. Usage totals are operational telemetry, not billing-grade. The Docker image is unbuilt. A prototype, not production-certified.

Project 02 · Agent identity

actas

Live demo

Delegation tokens for AI agents: a reference implementation of RFC 8693 (OAuth 2.0 Token Exchange), built from public specs.

When one AI agent hands work to another, actas makes sure the permissions can only shrink, never grow - and a stolen token is useless without the key it was bound to.

Asha · user read:calendar read:profile write:notes · 3600s planner-bot aud: calendar-api · 600s keeps: read:calendar write:notes drops: read:profile summarizer-tool nested delegation · 300s keeps: read:calendar drops: write:notes widening attempt invalid_scope: admin:all denied key-bound token (cnf.jkt) stolen token, no key: rejected Hash-chained audit log grants, denials, rejections · tamper-evident a token can only narrow · never widen
The demo's actual exchange story, rendered from real responses: scope and lifetime shrink at each hop, a widening request is denied, and a stolen token fails without the key it was bound to.
Try the live demo

Build a delegation chain, then watch a widening attempt get refused, a copied token rejected and a replayed proof rejected - on a fresh throwaway instance. A policy workbench builds boundary cases, edits one agent's limits through a guided form, and compares a candidate against a saved baseline to show which decisions flip before you adopt it - a planning tool, not a running authorization server.

The engineering

  • Agents receive tokens that can only shrink: less scope, bounded lifetime, narrowed audience, with the full delegation chain embedded in the token.
  • Per-agent policy at every hop, and every grant and refusal recorded in a hash-chained audit log.
  • A standalone resource server verifies tokens over remote JWKS in a separate process: the real topology, not shared state.
  • DPoP-style ES256 sender constraint (method, URL, time, token hash): at the token endpoint a live proof is verified and the issued token is bound to that key via a cnf.jkt claim, so presenting a token later requires the key it was bound to, and a replayed proof is rejected; on a persistent single instance the proof cache survives restarts, and an opt-in server-nonce mode adds the RFC 9449 challenge flow (120-second, single-use).
  • The original threat document has not been recovered; responses carry hardening headers (content-type sniffing disabled, a content security policy restricting connections to the same origin (inline scripts, styles and Google Fonts allowed), per-request IDs for tracing).
  • Operator tooling: structured JSON request logs (method, path, status and duration only, never headers, queries or bodies), per-process metrics with a request ID per call, and signing-key rotation with a retirement window.
Verification
Recovered 0.14.1 baseline, checked 11 Nov 2026: 48 pytest cases (28 new recovery cases plus the 20-case lab regression suite), 17 integration checks, 26 process checks and desktop/390px browser workflows. These are new recovery checks, not the lost original development suite; original test and operational/threat files have not been recovered.
Stack
Python, FastAPI, RS256 JWTs, ES256 sender constraints, JWKS endpoint with key rotation

Honest limits

Not a production authorization server and not independently audited. The public demo is stateless and in-memory: every lab run uses a fresh throwaway instance that stores nothing, so nothing carries across runs, and admin and revocation endpoints are disabled there. Metrics on the public demo are per-instance and reset on restart. Sender constraints are a DPoP-style subset: replay tracking is per server, durable across restarts only when the server runs with persistence, so on a multi-instance host it is best-effort, not global replay prevention. The opt-in server-nonce mode (120-second, single-use) is off on the public demo. The hash-chained log is tamper-evident, not tamper-proof.

authlib/authlib · Merged 10 Nov 2026

IPv6 signatures, corrected

Fixed default-port handling for IPv6 hosts in OAuth 1.0a signature base-string URIs. A host such as http://[::1]:80/a now correctly normalizes to http://[::1]/a, while non-default ports are preserved.

Regression tests cover IPv4 and IPv6 hosts with default, non-default and missing ports. Accepted and merged upstream in Authlib.

View merged PR #1031

gookit/goutil · Merged 12 Nov 2026

JSON dates, decoded properly

Fixed timex.Time.UnmarshalJSON in gookit's Go utility library, which stripped the first and last bytes of its input instead of decoding the JSON string. An escaped timestamp failed to decode, a bare number could be misread as a date, and 0 or 1 caused a slice-bounds panic.

The fix decodes the JSON token with encoding/json before handing the value to the existing parser - no new date parser or dependency. 24 added table cases cover escaped strings, request-binding numbers, null handling and state preservation; the patched full suite passes. Accepted and merged upstream in goutil.

View merged PR #316

Next entries in the series. Each is picked to exercise skills that current backend, platform and AI-infrastructure openings actually list, and each ships tested, measured and written up.

03

Agent reliability harness

A fixed eval set with graded answers, failure injection and a regression report wrapped around an existing equity-research agent.

Tentative

04

Postgres realtime engine

Stream row changes to connected clients using logical replication and row-level security.

Candidate

Most recently I was SDE II on the AWS UnifiedAuth platform in Hyderabad: service-to-service identity, authorization and trust propagation for agentic workflows. Before that, Spring Boot backend for HSBC's UK and Hong Kong mobile apps, preceded by a machine learning internship at HighRadius.

Core stack
Python, Java, Spring Boot; AWS, Kubernetes, Docker, CI/CD
Focus areas
Backend platforms, auth and identity (OAuth2), AI agents, observability
ML background
Time series, anomaly detection, forecasting (Kats, TensorFlow, scikit-learn)

Let's talk.