Earlier quoted context omitted.
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.
Reverse Engineering Cursor's LLM Client
11–20 of 38 posts
Re: Reverse Engineering Cursor's LLM Client
#12There 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...
The Gist you shared is a good resource too though!
Re: Reverse Engineering Cursor's LLM Client
#13Re: Reverse Engineering Cursor's LLM Client
#14There 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
#15There 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
#16From the extracted prompting Cursor is using:
> Each time the USER sends a message, we may automatically attach some information about their current state…edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide.
This is the context bloat that limits effectiveness of LLMs in solving very hard problems.
This particular .env example illustrates the low stakes type of problem cursor is great at solving but also lacks the complexity that will keep SWE’s employed.
Instead I suggest folks working with AI start at chat interface and work on editing conversations to keep clean contexts as they explore a truly challenging problem.
This often includes meeting and slack transcripts, internal docs, external content and code.
I’ve built a tool for surgical use of code called FileKitty: https://github.com/banagale/FileKitty and more recently slackprep: https://github.com/banagale/slackprep
That let a person be more intentional about what the problem they are trying to solve by only including information relevant to the problem.
Re: Reverse Engineering Cursor's LLM Client
#17Re: Reverse Engineering Cursor's LLM Client
#18I've been curious to see the process for selecting relevant context from a long conversation. has anyone reverse engineered what that looks like? how is the conversion history pruned, and how is the latest state of a file represented?
We plan to continue investigating how it works (+ optimize the models and prompts using TensorZero).
Re: Reverse Engineering Cursor's LLM Client
#19Hmm, now that we have the prompts, would it be possible to reimplement Cursor servers and have a fully local ( ahem pirated) version?
Re: Reverse Engineering Cursor's LLM Client
#20Cursor and other IDE modality solutions are interesting but train sloppy use of context. From the extracted prompting Cursor is using: > Each time the USER sends a message, we may automatically attach some information about their current state…edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide. This is the context b…