GenAiHub

Last checked 28 October 2026 — responded normally.

Authorize AI agent actions with Postgres, Slack, and PagerDuty alerts

Quick overview

Live
Open / InstallLast updated October 28, 2026

Description

Quick overview This workflow exposes a webhook-based policy-as-code authorization service that evaluates AI agent action requests against prioritized rules stored in Postgres, logs every decision for auditing, and optionally sends Slack and PagerDuty alerts for high-risk denials or approval requirements. How it works Receives a POST request on the /policy-evaluate webhook (or runs manually/on a schedule) to start an authorization evaluation. Ensures the required Postgres tables exist for policies, decisions, and run tracking. Loads enabled policies (ordered by priority) and 24-hour decision statistics from Postgres, then merges them with embedded fallback policies and configuration. Normalizes the incoming request, calculates a risk score, and evaluates policies in priority order to return the first matching effect (allow, deny, or require_approval). Writes the decision and a run summary to Postgres for auditability. If the decision is deny or require_approval and the risk score exceeds the configured threshold, sends a notification to Slack and optionally triggers PagerDuty for severe denials. Responds to the webhook caller with the final decision payload including the matched policy, reason, and risk score. Setup Configure a Postgres credential and ensure the target database is reachable from n8n. Update the embedded CONFIG values (especially the default effect, embedded policies, risk thresholds, Slack incoming webhook URL, and optional PagerDuty routing key). Activate the workflow and copy the webhook URL for /policy-evaluate into the AI agent/tooling that needs authorization checks. (Optional) Seed the agent_policies table with your own enabled policies to override the embedded fallback rules. An n8n automation workflow template by Oneclick AI Squad.

Community Metrics

Views
0
Avg Rating
N/A
Ratings
0
Likes
0
Comments
—

Author

Oneclick AI Squad

Platform

web

Pricing model

free

Categories

  • Automation

Tags

  • n8n
  • workflow
  • http-request
  • postgres
  • code

Capabilities

  • 3 nodes

Information

TypeWorkflow
Sourcen8n
AddedOctober 27, 2026

Comments

?

Others in the same category, ranked by how often they are opened.