Skip to content

How to add guardrails and access current date in the prompt flows ?

0

I am encountering two issues while building a prompt flow and would appreciate your assistance:

  1. Implementing Guardrails in Prompt Nodes: I am unable to find an option to add guardrails to the prompt nodes. Could you please guide me on how to incorporate guardrails into these nodes?

Enter image description here

  1. Accessing the Current Date in the LLM Model: I have noted that the $current_time$ function can be used to retrieve the current date when setting up a knowledge base prompt template in the builder tools. However, this functionality does not seem to be available in the prompt flow node. Despite configuring the prompt flow node to include instructions for the model, it does not recognize the $current_time$ option and defaults to the year 2023. How can I enable the LLM model to access the current date within the prompt flow node?
1 Answer
0

There is currently no direct way to add guardrails to individual prompt nodes in Amazon Bedrock. Guardrails can be associated at the agent level to evaluate user inputs and model responses across all prompts used by that agent. [1]

To implement additional guardrails for specific prompts, you would need to build that logic into the prompt text itself, for example by specifying allowed or denied topics. The prompts can also be configured to fallback to a predefined response for out-of-scope questions. [2]

Sources:

[1] URL: https://docs.aws.amazon.com/bedrock/latest/ug/guardrails-bedrock.html Title: "Guardrails for Amazon Bedrock" Description: "Guardrails for Amazon Bedrock helps implement safeguards customized to your use cases and responsible AI policies."

[2] URL: https://docs.aws.amazon.com/bedrock/latest/ug/conversation-design.html Title: "Design effective conversations" Description: "You can configure the prompt templates to limit the scope of responses or provide fallback messages."

AWS
EXPERT
answered a year ago
  • Thank you for your response. Unfortunately, the links provided are not working. Could you please provide updated or alternative links? I appreciate your help!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.