Help: Can't Use Values of Secrets When Arming SimpliSafe

I’m trying to start using the secrets.yaml file to store my alarm codes for SimpliSafe. My secrets are working when I try to access them elsewhere (like in the configuration.yaml file), but when I try to call the secret from a script it throws an error (see image).

My alarm code is just a simple alphanumeric string, and I’ve tried both with and without quotes in secrets.yaml.

alias: Arm security system to away
sequence:
  - service: alarm_control_panel.alarm_arm_away
    data:
      entity_id: alarm_control_panel.my_alarm_control_panel
      code: !secret alarm_code
mode: single