-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What?
We need to build nexus-sidecar, a standalone proxy service designed to be deployed alongside an AI Agent (e.g., as a Kubernetes sidecar container or a local background process).
Currently, our token retrieval and cryptographic request signing logic is embedded in nexus-bridge, which is a Go library. The sidecar will encapsulate this logic into an independent proxy, allowing agents written in any language to leverage Nexus without needing language-specific SDKs.
Why?
- Polyglot Support (Python & Node.js First): The AI ecosystem is heavily dominated by Python and TypeScript. Building and maintaining complex, secure cryptographic middleware (like handling DPoP, mTLS, or OAuth 1.0a signatures) natively in every language is prone to bugs and massive maintenance overhead. The sidecar allows developers to use standard HTTP clients (
requests,axios) to make API calls, while the sidecar handles the complex auth injection. - Zero-Knowledge Agent Architecture: AI agents are highly susceptible to novel attack vectors like Prompt Injection leading to Remote Code Execution (RCE). If an agent is compromised and it holds API access tokens in its memory (RAM), those tokens can be exfiltrated. By moving the signing logic out-of-process into the sidecar, the agent never actually sees the raw access tokens. Even a fully compromised agent yields no long-term credentials to an attacker.
Sample Approach (The "How")
- The Request: A Python agent wants to fetch data from GitHub. Instead of calling
api.github.comdirectly, it makes an unauthenticated HTTP request to the local sidecar:GET http://localhost:8080/user/repos X-Nexus-Provider: github X-Nexus-Tenant: tenant_123
- Interception & Credential Fetching: The sidecar (running on
localhost:8080) intercepts the request. It identifies the target provider and tenant, then communicates securely withnexus-gateway/nexus-brokerto retrieve a fresh, valid access token for that specific connection. - Cryptographic Signing: The sidecar modifies the outgoing request, injecting the necessary
Authorization: Bearer <token>headers, calculating any required cryptographic signatures, or applying mTLS certificates. - Forwarding: The sidecar acts as a transparent reverse proxy, forwarding the newly authenticated request to
api.github.com. - Response: The sidecar receives the response from GitHub and passes it back to the Python agent.
Where to Begin
- Scaffold the Service: Create a new top-level directory
nexus-sidecarand initialize a Go module. - Reverse Proxy Foundation: Utilize Go's
net/http/httputil.ReverseProxyto build a robust foundation capable of intercepting and rewriting HTTP requests. - Integrate
nexus-bridge: Import the existingnexus-bridgelibrary into the sidecar. Use it as middleware to handle the heavy lifting of token retrieval and request modification. - Configuration & Routing: Define a clean way for the proxy to know where to route traffic (e.g., mapping
X-Nexus-Provider: githubtohttps://api.github.com). - Proof of Concept: Write a simple Python script using the
requestslibrary that successfully queries an upstream API through the sidecar without knowing any secrets.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request