{
  "id": "expr-map-string-string-is-a-map-for-in-and-size",
  "title": "A map<string,string> host fact answers in and size(), and indexes to a string",
  "covers": [
    "OAR-EXPR-21",
    "OAR-EXPR-12",
    "OAR-EXPR-13"
  ],
  "rules": [
    {
      "oar": "1.0",
      "namespace": "oar.test",
      "kind": "policy",
      "anchor": "tool.pre_invoke",
      "id": "LABELS",
      "effect": "warn",
      "requires": {
        "facts": [
          "oar.testhost.labels"
        ]
      },
      "when": "\"env\" in oar.testhost.labels && size(oar.testhost.labels) == 2 && oar.testhost.labels[\"env\"] == \"prod\""
    }
  ],
  "input": {
    "capability": {
      "oar_capability_version": "1.0",
      "host": "oar.testhost",
      "anchors": {
        "core": {
          "tool.pre_invoke": "tool.pre_invoke",
          "tool.handler": "tool.handler",
          "tool.post_invoke": "tool.post_invoke",
          "agent.post_turn": "agent.post_turn",
          "agent.finalize": "agent.finalize",
          "model.input": "model.input",
          "model.output": "model.output",
          "model.tool_result": "model.tool_result"
        },
        "unsupported": []
      },
      "profiles": [],
      "activity_window": 0,
      "detectors": [],
      "expression_nodes_max": 1024,
      "supports_transform": false,
      "host_facts": [
        {
          "name": "oar.testhost.labels",
          "type": "map<string,string>"
        }
      ]
    },
    "anchor": "tool.pre_invoke",
    "facts": {
      "oar.testhost.labels": {
        "env": "prod",
        "tier": "gold"
      }
    }
  },
  "expected": {
    "decision": "warn",
    "code": "LABELS"
  }
}
