Prevent exposing system prompt with assistant conf...
# support
w
I am looking for a way to prevent sending the entire system prompt and other messages to the frontend with the agents. If you could provide an example which does not leak the messages with the agent that would be great. I have a NextJs fullstack app which needs to take in voice as input -> transcript-> custom llm -> return TTS. I do not want to leak the system prompt/messages to the frontend. Similar request as this thread; https://discord.com/channels/1211482211119796234/1290311654709399603/1290311654709399603
v
You can continue this conversation by mentioning me in the message.
@winterr Certainly! To ensure that system prompts and other messages are not sent to the frontend with the agents, you can configure your Server URL to only receive specific messages that are relevant to your application's workflow. In your case, since you want to take in voice as input, transcribe it, process it through a custom LLM, and return TTS, you would likely want to receive the 'voice-input' and 'transcript' messages. Here's an example configuration for your VAPI setup:
Copy code
json
{
  "squad": {
    "members": {
      "assistant": {
        "serverMessages": [
          "voice-input",
          "transcript"
        ]
      }
    }
  }
}
With this configuration, only 'voice-input' and 'transcript' messages will be sent to your Server URL. This prevents any system prompts or other messages from being leaked to the frontend. Remember to implement server-side logic to handle the voice input and transcript data, process it through your custom LLM, and then use a TTS service to return the spoken output to the frontend without exposing any system messages. If you need further assistance with setting up your server or handling the data flow, please let me know!
s
@winterr you can join discord OH and get your ticket resolved over there.
you can use your backend as middle layer or a proxy middle ware for this.
Copy code
client -> backend -> vapi
@winterr let me know if your require further help.
3 Views