Live data from Hacker News

Reverse Engineering Cursor's LLM Client

tensorzero.com

1–10 of 38 posts

Re: Reverse Engineering Cursor's LLM Client

#3

Soooo.... wireshark is no longer available or something?

The article literally says at the end this was just the first post about looking before getting into actually changing the responses.

(that being said, mitmproxy has gotten pretty good for just looking lately https://docs.mitmproxy.org/stable/concepts/modes/#local-capt... )

Re: Reverse Engineering Cursor's LLM Client

#4

Soooo.... wireshark is no longer available or something?

wireshark would work for seeing the requests from the desktop app to Cursor’s servers (which make the actual LLM requests). But if you’re interested in what the actual requests to LLMs look like from Cursor’s servers you have to set something like this up. Plus, this lets us modify the request and A/B test variations!

Re: Reverse Engineering Cursor's LLM Client

#6
There is much missing from this prompt, tool call descriptors is the most obvious. See for yourself using even a year old jailbreak [1]. There’s some great ideas in how they’ve setup other pieces such as cursor rules.

[1]: https://gist.github.com/lucasmrdt/4215e483257e1d81e44842eddb...

Re: Reverse Engineering Cursor's LLM Client

#7
post #6

There is much missing from this prompt, tool call descriptors is the most obvious. See for yourself using even a year old jailbreak [1]. There’s some great ideas in how they’ve setup other pieces such as cursor rules. [1]: https://gist.github.com/lucasmrdt/4215e483257e1d81e44842eddb...

Maybe there is some optimization logic that only appends tool details that are required for the user’s query?

I’m sure they are trying to slash tokens where they can, and removing potentially irrelevant tool descriptors seems like low-hanging fruit to reduce token consumption.

Re: Reverse Engineering Cursor's LLM Client

#8
post #4

Soooo.... wireshark is no longer available or something?

wireshark would work for seeing the requests from the desktop app to Cursor’s servers (which make the actual LLM requests). But if you’re interested in what the actual requests to LLMs look like from Cursor’s servers you have to set something like this up. Plus, this lets us modify the request and A/B test variations!

Sorry, can you explain this a bit more? Either you're putting something between your desktop to the server (in which case Wireshark would work) or you're putting something between Cursor's infrastructure and their LLM provider, in which case, how?

Re: Reverse Engineering Cursor's LLM Client

#9
post #8
post #4

Earlier quoted context omitted.

wireshark would work for seeing the requests from the desktop app to Cursor’s servers (which make the actual LLM requests). But if you’re interested in what the actual requests to LLMs look like from Cursor’s servers you have to set something like this up. Plus, this lets us modify the request and A/B test variations!

Sorry, can you explain this a bit more? Either you're putting something between your desktop to the server (in which case Wireshark would work) or you're putting something between Cursor's infrastructure and their LLM provider, in which case, how?

we're doing the latter! Cursor lets you configure the OpenAI base URL so we were able to have Cursor call Ngrok -> Nginx (for auth) -> TensorZero -> LLMs. We explain in detail in the blog post.

Re: Reverse Engineering Cursor's LLM Client

#10
post #6

There is much missing from this prompt, tool call descriptors is the most obvious. See for yourself using even a year old jailbreak [1]. There’s some great ideas in how they’ve setup other pieces such as cursor rules. [1]: https://gist.github.com/lucasmrdt/4215e483257e1d81e44842eddb...

Maybe there is some optimization logic that only appends tool details that are required for the user’s query? I’m sure they are trying to slash tokens where they can, and removing potentially irrelevant tool descriptors seems like low-hanging fruit to reduce token consumption.

I definitely see different prompts based on what I'm doing in the app. As we mentioned there are different prompts for if you're asking questions, doing Cmd-K edits, working in the shell, etc. I'd also imagine that they customize the prompt by model (unobserved here, but we can also customize per-model using TensorZero and A/B test).
Post reply on HN