{
  "name": "Vorlux AI | Agent Autonomy Guardrail",
  "nodes": [
    {
      "id": "a22d22f5-1855-4aec-880d-f925936b5c7b",
      "name": "Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 5
            }
          ]
        }
      }
    },
    {
      "id": "df684794-6e4f-43a2-9822-7e3c440684b0",
      "name": "Fetch Data",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "method": "GET",
        "url": "={{$env.VORLUX_HUB_URL}}/api/agents/actions?period=5m",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "9f3e192c-d890-4dca-862c-bb7e7c37f5e4",
      "name": "Process",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        740,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const actions=$input.first().json.data||[];\nconst blocked=['delete_user','drop_table','send_email_blast','modify_billing'];\nconst violations=[];\nconst counts={};\nfor(const a of actions){const id=a.agentId||'?';counts[id]=(counts[id]||0)+1;if(counts[id]>10)violations.push({agent:id,type:'rate_limit',detail:counts[id]+' actions'});if(blocked.includes(a.type))violations.push({agent:id,type:'blocked',detail:a.type});}\nif(actions.length>20)violations.push({agent:'system',type:'volume',detail:actions.length+' actions/5min'});\nreturn [{json:{violations,hasViolations:violations.length>0,total:actions.length}}];"
      }
    },
    {
      "id": "ebd8a5c9-9267-4aab-a996-02d207f91e78",
      "name": "Post Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        980,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_OPS_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.embeds ? $json : {embeds:[{title:$json.mood||$json.status||\"Update\",description:JSON.stringify($json).substring(0,500),color:5793266}]}) }}",
        "options": {
          "timeout": 10000
        }
      }
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Fetch Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Data": {
      "main": [
        [
          {
            "node": "Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process": {
      "main": [
        [
          {
            "node": "Post Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}