version: "2"

# Default compatibility registry shipped with agent_framework_oci.
#
# This file reproduces the historical behavior that used to be hardcoded in
# OutputSupervisor / ParallelRailExecutor. It is ALWAYS loaded by the framework.
# An agent/deployment observability_mapping.yaml is then applied as an overlay.
#
# Therefore an older agent can replace only the framework and keep the same
# GRL contract and legacy guardrail actions without adding new configuration.
mappings:
  # Historical OutputSupervisor taxonomy.
  guardrail.output_supervisor.started:
    label: GRL.001
  guardrail.result.allow:
    label: GRL.002
  guardrail.result.sanitize:
    label: GRL.003
  guardrail.result.block:
    label: GRL.004
  guardrail.result.retry:
    label: GRL.005
  guardrail.result.handover:
    label: GRL.006
  guardrail.result.observe:
    label: GRL.007
  guardrail.fail_closed:
    label: GRL.008
  guardrail.output_supervisor.completed:
    label: GRL.009

  # Named guardrail events historically emitted as GRL.<RAIL_CODE>.
  guardrail.input_size: {label: GRL.INPUT_SIZE, aliases: [INPUT_SIZE, SIZE]}
  guardrail.msk: {label: GRL.MSK, aliases: [MSK, PII]}
  guardrail.tox: {label: GRL.TOX, aliases: [TOX]}
  guardrail.pinj: {label: GRL.PINJ, aliases: [PINJ]}
  guardrail.jailbreak: {label: GRL.JAILBREAK, aliases: [JAILBREAK]}
  guardrail.vloop: {label: GRL.VLOOP, aliases: [VLOOP, LOOP]}
  guardrail.dlex_in: {label: GRL.DLEX_IN, aliases: [DLEX_IN]}
  guardrail.oos: {label: GRL.OOS, aliases: [OOS]}
  guardrail.coer: {label: GRL.COER, aliases: [COER]}
  guardrail.msk_out: {label: GRL.MSK_OUT, aliases: [MSK_OUT, OUTPUT_MSK]}
  guardrail.toxout: {label: GRL.TOXOUT, aliases: [TOXOUT, TOX_OUT]}
  guardrail.aoferta: {label: GRL.AOFERTA, aliases: [AOFERTA, PROACTIVE_OFFER]}
  guardrail.dlex_out: {label: GRL.DLEX_OUT, aliases: [DLEX_OUT]}
  guardrail.aluc_risk: {label: GRL.ALUC_RISK, aliases: [ALUC_RISK, HALLUCINATION_RISK]}
  guardrail.ret_rel: {label: GRL.RET_REL, aliases: [RET_REL, RETRIEVAL_RELEVANCE]}
  guardrail.ragsec: {label: GRL.RAGSEC, aliases: [RAGSEC]}
  guardrail.tool_val: {label: GRL.TOOL_VAL, aliases: [TOOL_VAL, TOOL_VALIDATION]}

  # Historical action-by-name behavior, now declarative.
  guardrail.revprec:
    label: GRL.REVPREC
    action: retry
    aliases: [REVPREC, PREMATURE_ACTION]
  guardrail.cmp:
    label: GRL.CMP
    action: retry
    aliases: [CMP, COMPLIANCE]
  guardrail.sco:
    label: GRL.SCO
    action: retry
    aliases: [SCO]
  guardrail.gnd:
    label: GRL.GND
    action: retry
    aliases: [GND, GROUNDEDNESS]
  guardrail.handover:
    action: handover
    aliases: [HANDOVER, ATH, HUMAN]

  # Historical FRASEOLOGIA special-case rewrite, now capability-driven.
  guardrail.fraseologia:
    label: GRL.FRASEOLOGIA
    aliases: [FRASEOLOGIA]
    remediation:
      type: rewrite
      max_attempts: 1
      prompt_id: FALLBACK
      profile_name: grl
      component_name: guardrail.fraseologia.rewrite
      generation_name: guardrail.fraseologia.rewrite
