Agent scripting api returning 400 on dynamic variable injection

Is there a clean way to handle dynamic variable injection when creating agent scripts via the platform api? we are building a premium app that programmatically generates scripts based on customer segment data. the initial creation of the script block works fine using post /api/v2/agent-scripts/script-blocks. however, when we attempt to add a text block with a dynamic variable reference like {{customer.tier}}, the api returns a 400 bad request. the error message states ‘invalid variable reference’. we have verified the variable exists in the target org’s data model and is accessible to the service account. is there a specific format required for the variable string in the payload, or does the api require the variable to be pre-registered in a specific scope before it can be referenced in a script block? we are using the node.js sdk v5.1.2 and the tenant is on the latest platform version. any insights into the validation logic for dynamic fields would be appreciated.