Use case 01 · privileged operations

Stop Unsafe Production Actions Before Execution

Intercept shell commands, infrastructure changes, permission updates, and destructive database operations before a production side effect occurs.

Primary question
How can a platform team prevent an agent from executing a privileged or destructive production action outside policy?
Type
Use case
Verified
2026-10-04
Public package
fivedrisk 0.7.0
Source
c22213b
Expected outcome

What this path changes

The host receives an explicit policy disposition before the privileged tool is called and can permit, hold, or block the action.

Deployment brief

The action, boundary, and evidence

Buyer

Who owns the risk

Platform engineers, AI engineers, security architects, and CISOs responsible for privileged agent tool access.

Trigger

When the gate runs

An agent proposes a shell command, deployment, infrastructure mutation, permission change, credential operation, or destructive database action.

Composition

How to configure assurance

Use deterministic 5D policy for explicit prohibitions and thresholds. Add Jev, another contextual LLM, or both when intent needs semantic interpretation. Observer evidence never clears a deterministic block.

Actions to govern
  • Run a privileged shell command or copied command from an untrusted page.
  • Delete storage, mutate production data, or deploy unreviewed code.
  • Change IAM permissions, rotate credentials, or open network access.
Evidence to demand
  • A gated-versus-ungated interception test proving the tool is not called on block.
  • Blocked-action receipts, failure-path tests, latency overhead, and a documented bypass boundary.

Next: Test a privileged-action policy against a non-production tool path.

Relevant deployment example

Follow a matching proposed action through the gate.

Synthetic tested action under the pinned 5D 0.7.0 illustrative policy.

Coding agent

Drop a live database while repairing a migration

The agent mistakes the live target for a disposable test environment. Under the pinned illustrative policy, the expected result is that the action is ineligible for execution.

D3T4R4E4A4
Do not execute · Score 2.83
Tool
database.execute
Target
live primary database
Purpose
repair migration

5D suppliesA deterministic RED decision before the call.

Host ownsRouting every database executor through the gate and refusing the call.

Coverage limitA direct or alternate database path bypasses this gate.

Framework references

Where this control fits in the governance lifecycle.

These references identify possible technical-evidence contributions. They do not mean every framework applies to every deployment.

This mapping identifies possible technical-evidence contributions. It is not legal advice, certification, conformity assessment, readiness scoring, a compliance conclusion, or proof that an AI deployment is safe. Applicability, governance, integration coverage, and deployment outcomes remain the organisation's responsibility.

Deployment contract

Bind and deploy

Which approved control covers each execution path?

Singapore Agentic AI Partial mapping

Dimension 3 — Implement technical controls and processesControl access to approved tools and services

What 5D helps with: Gateways and adapters can attach action policy to documented tool-call paths.

What 5D does not establish: The host must prove complete interception, authenticate identity, secure configuration and operate the surrounding controls.

Official source ↗
OWASP Agentic Partial mapping

ASI02 Tool Misuse and Exploitation — mitigation 1; ASI03 Identity and Privilege AbuseLeast agency, tool boundaries and privilege context

What 5D helps with: 5D can enforce one declared tool-policy boundary using caller-supplied identity and authority context.

What 5D does not establish: 5D does not mitigate the complete ASI risks, authenticate identity, validate grants or guarantee complete action-path interception.

Official source ↗
Organisation retains: Identity authentication, topology, complete interception coverage, secure configuration, availability, rollback, and change management.
Runtime core

Enforce at action time

May this proposed action cross the boundary?

EU AI Act Partial mapping

Articles 9(5)–(6), 14 and 15(1), 15(4)Risk treatment, human oversight, robustness and cybersecurity

What 5D helps with: Pre-action prohibitions, routing and a policy-selected human hold can implement one technical risk-treatment measure.

What 5D does not establish: Only relevant where these duties apply to the actor and system; 5D does not establish the wider risk system, oversight design, robustness or cybersecurity.

Official source ↗
NIST AI RMF Partial mapping

MANAGE 1.2–1.3Prioritise and document risk treatment

What 5D helps with: Permit, hold and block policy can implement one documented treatment for selected action risks.

What 5D does not establish: 5D does not prioritise organisation-wide risk or determine risk acceptance and treatment sufficiency.

Official source ↗
Organisation retains: Correct context, authenticated identity and grants, secure interception, execution authority, downstream enforcement, and alternate-path prevention.
Public interface

Gate a function

python
from fivedrisk.hooks import gate

@gate(tool_name="write_to_database", autonomy_context=2)
async def write_record(table: str, data: dict) -> None:
    ...

Written for fivedrisk==0.7.0. Verify against the immutable source and public documentation before use.

Intercept the proposed action

Wrap the tool entry point or use a supported framework hook so the policy check runs before the side effect. Supply the tool name, arguments, autonomy context, and any identity or destination context required by policy.

Resolve clear cases in code

Manual score() returns an inspectable band. The @gate decorator executes GREEN and YELLOW paths, while ORANGE and RED raise or invoke the configured on_block handler. The host must supply any review workflow and must keep alternate execution paths behind the same boundary.

Keep enforcement in the host

The application must honor the result, route approval-required cases, and refuse unresolved actions. A bypass around the wrapped path remains a bypass around governance.

Limits

What this page does not establish

  • The gate evaluates the action context it receives. Missing or inaccurate context weakens the decision.
  • Coverage depends on wiring every relevant execution path through the gate.
  • The verdict addresses action risk, not whether the agent's goal or reasoning is correct.