{
  "dashboard": {
    "id": null,
    "uid": "agent-os-overview",
    "title": "Agent OS - Overview",
    "tags": [
      "agent-os",
      "ai-safety"
    ],
    "timezone": "browser",
    "schemaVersion": 38,
    "version": 1,
    "refresh": "10s",
    "panels": [
      {
        "id": 1,
        "type": "stat",
        "title": "Violation Rate",
        "gridPos": {
          "h": 4,
          "w": 6,
          "x": 0,
          "y": 0
        },
        "targets": [
          {
            "expr": "agent_os_violation_rate{window='all_time'}",
            "refId": "A"
          }
        ],
        "options": {
          "colorMode": "value",
          "graphMode": "none",
          "orientation": "auto",
          "textMode": "value_and_name"
        },
        "fieldConfig": {
          "defaults": {
            "unit": "percentunit",
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                },
                {
                  "color": "yellow",
                  "value": 0.001
                },
                {
                  "color": "red",
                  "value": 0.01
                }
              ]
            }
          }
        }
      },
      {
        "id": 2,
        "type": "stat",
        "title": "SIGKILL Count (24h)",
        "gridPos": {
          "h": 4,
          "w": 6,
          "x": 6,
          "y": 0
        },
        "targets": [
          {
            "expr": "increase(agent_os_sigkill_total[24h])",
            "refId": "A"
          }
        ],
        "options": {
          "colorMode": "value"
        }
      },
      {
        "id": 3,
        "type": "stat",
        "title": "Kernel Uptime",
        "gridPos": {
          "h": 4,
          "w": 6,
          "x": 12,
          "y": 0
        },
        "targets": [
          {
            "expr": "agent_os_kernel_uptime_seconds",
            "refId": "A"
          }
        ],
        "fieldConfig": {
          "defaults": {
            "unit": "s"
          }
        }
      },
      {
        "id": 4,
        "type": "stat",
        "title": "Active Agents",
        "gridPos": {
          "h": 4,
          "w": 6,
          "x": 18,
          "y": 0
        },
        "targets": [
          {
            "expr": "agent_os_active_agents",
            "refId": "A"
          }
        ]
      },
      {
        "id": 5,
        "type": "timeseries",
        "title": "Requests per Second",
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 0,
          "y": 4
        },
        "targets": [
          {
            "expr": "rate(agent_os_requests_total[1m])",
            "legendFormat": "{{action}} - {{status}}",
            "refId": "A"
          }
        ]
      },
      {
        "id": 6,
        "type": "timeseries",
        "title": "Policy Check Latency (p99)",
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 12,
          "y": 4
        },
        "targets": [
          {
            "expr": "histogram_quantile(0.99, rate(agent_os_policy_check_duration_seconds_bucket[5m]))",
            "legendFormat": "p99",
            "refId": "A"
          },
          {
            "expr": "histogram_quantile(0.50, rate(agent_os_policy_check_duration_seconds_bucket[5m]))",
            "legendFormat": "p50",
            "refId": "B"
          }
        ],
        "fieldConfig": {
          "defaults": {
            "unit": "s",
            "thresholds": {
              "steps": [
                {
                  "color": "green",
                  "value": null
                },
                {
                  "color": "yellow",
                  "value": 0.005
                },
                {
                  "color": "red",
                  "value": 0.01
                }
              ]
            }
          }
        }
      },
      {
        "id": 7,
        "type": "timeseries",
        "title": "Violations Over Time",
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 0,
          "y": 12
        },
        "targets": [
          {
            "expr": "rate(agent_os_violations_total[5m])",
            "legendFormat": "{{policy}}",
            "refId": "A"
          }
        ],
        "fieldConfig": {
          "defaults": {
            "custom": {
              "fillOpacity": 30
            }
          }
        }
      },
      {
        "id": 8,
        "type": "timeseries",
        "title": "Signals Sent",
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 12,
          "y": 12
        },
        "targets": [
          {
            "expr": "rate(agent_os_signals_total[5m])",
            "legendFormat": "{{signal}}",
            "refId": "A"
          }
        ]
      },
      {
        "id": 9,
        "type": "histogram",
        "title": "MTTR Distribution",
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 0,
          "y": 20
        },
        "targets": [
          {
            "expr": "agent_os_mttr_seconds_bucket",
            "refId": "A"
          }
        ],
        "fieldConfig": {
          "defaults": {
            "unit": "s"
          }
        }
      },
      {
        "id": 10,
        "type": "table",
        "title": "Recent Violations",
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 12,
          "y": 20
        },
        "targets": [
          {
            "expr": "topk(10, agent_os_violations_total)",
            "format": "table",
            "refId": "A"
          }
        ]
      }
    ]
  },
  "folderId": 0,
  "overwrite": true
}