
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Enterprise-grade Open Policy Agent (OPA) integration for pi coding agent - comprehensive authorization, authentication, and policy enforcement
Enterprise-grade Open Policy Agent (OPA) integration for pi coding agent. Provides comprehensive authorization, authentication, and policy enforcement for multi-agent systems.
pi-opa brings enterprise-class authorization to pi using the industry-standard Open Policy Agent (OPA). It enables:
opa) - Install OPA# Via npm (recommended)
pi install npm:pi-opa
# Via git
pi install git:github.com/DrOlu/pi-opa
/opa-start
# OPA server started on localhost:8181
/opa-template my_policy
# Created: ~/.pi/agent/opa/policies/my_policy.rego
Edit the generated policy file to add your rules.
/opa-check ci-bot deploy production
# ✅ ALLOWED
# Agent: ci-bot
# Action: deploy
# Resource: production
# Reason: Agent has high trust level and is within business hours
| Command | Description |
|---|---|
/opa-check | Check authorization for an action |
/opa-start | Start OPA server |
/opa-stop | Stop OPA server |
/opa-status | Show OPA status |
| Command | Description |
|---|---|
/opa-load | Load policies from directory |
/opa-test | Test policies |
/opa-validate | Validate policy syntax |
/opa-template | Create policy template |
| Command | Description |
|---|---|
/opa-audit | Show authorization audit log |
/opa-export-audit | Export audit log (json/csv) |
| Command | Description |
|---|---|
/opa-config | Configure settings |
/opa-help | Show help |
Policies are written in OPA's Rego language:
package pi.authz
# Default deny
default allow := false
# Allow trusted agents to read non-sensitive resources
allow if {
input.agent.trust_level == "high"
input.action.category == "read"
input.resource.classification != "secret"
}
# Deny destructive actions after hours
deny contains violation if {
input.action.category == "delete"
not is_business_hours
violation := {
"policy": "business_hours",
"rule": "no_destructive_after_hours",
"message": "Destructive actions not allowed outside 9-5"
}
}
is_business_hours if {
time.now_ns >= time.parse_rfc3339_ns("2026-01-01T09:00:00Z")
time.now_ns <= time.parse_rfc3339_ns("2026-01-01T17:00:00Z")
}
OPA can evaluate multiple factors:
pi-opa integrates with pi-a2a-communication for agent-to-agent authorization:
# Enable A2A authorization
/opa-config integration.a2aEnabled true
/opa-config integration.requireOPAForA2A true
# Now all A2A requests go through OPA
/a2a-send some-agent "do something"
# → OPA evaluates authorization first
Evaluate authorization programmatically:
{
"tool": "opa_evaluate",
"params": {
"agent": "ci-bot",
"action": "deploy",
"resource": "production",
"context": {
"time": "14:00",
"emergency": false
}
}
}
Validate policy syntax:
{
"tool": "opa_check_policy",
"params": {
"policy_file": "./my_policy.rego"
}
}
Default configuration location: ~/.pi/agent/opa/config.json
{
"opa": {
"binaryPath": "opa",
"serverPort": 8181,
"serverHost": "localhost",
"autoStart": true,
"logLevel": "info"
},
"policies": {
"directory": "~/.pi/agent/opa/policies",
"defaultPackage": "pi.authz",
"autoReload": true,
"testOnLoad": true
},
"authorization": {
"defaultDecision": "deny",
"cacheDecisions": true,
"cacheTTL": 300000,
"requireAuthentication": true
},
"audit": {
"enabled": true,
"logDirectory": "~/.pi/agent/opa/audit",
"retentionDays": 90,
"logSuccessful": true,
"logFailed": true
}
}
All authorization decisions are logged with:
Export to JSON or CSV for compliance reporting.
Write tests for your policies:
package pi.authz_test
import data.pi.authz
test_allow_trusted_read if {
authz.allow with input as {
"agent": {"trust_level": "high"},
"action": {"category": "read"},
"resource": {"classification": "internal"}
}
}
Frequently evaluated decisions are cached for performance (configurable TTL).
Update policies without restarting - changes take effect immediately.
# No destructive operations after 6 PM
deny contains violation if {
input.action.category == "delete"
time.now_ns > time.parse_rfc3339_ns("${TODAY}T18:00:00Z")
violation := {
"policy": "time_based",
"message": "Destructive ops only allowed 9-6"
}
}
# Customer data only for assigned agents
allow if {
input.resource.type == "customer_data"
input.agent.id == input.resource.assigned_agent
}
# Emergency break-glass
allow if {
input.context.emergency == true
input.context.incident_id != ""
input.agent.on_call == true
}
pi-opa works with:
MIT License - See LICENSE
Contributions welcome! Please ensure:
Secure your multi-agent workflows with pi-opa! 🔒
FAQs
Enterprise-grade Open Policy Agent (OPA) integration for pi coding agent - comprehensive authorization, authentication, and policy enforcement
We found that pi-opa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.