Home / Coding portfolio / Agentic AI
Coding portfolio / Agentic AI

Agent action policy

I demonstrate a deterministic permission gate that distinguishes allowed, approval-required and blocked tool actions.

Educational reference implementation · synthetic example

Source code

"""Educational action gate. Enforce authorization on the server in real systems."""
def decide(action, allowed, sensitive, approved=False):
    if action not in allowed:
        return "blocked"
    if action in sensitive and not approved:
        return "approval-required"
    return "allowed"

if __name__ == "__main__":
    allowed = {"read_document", "send_notification"}
    sensitive = {"send_notification"}
    assert decide("delete_record", allowed, sensitive) == "blocked"
    assert decide("send_notification", allowed, sensitive) == "approval-required"
    assert decide("read_document", allowed, sensitive) == "allowed"
    print("All illustrative policy checks passed.")

How I approach the implementation

I keep the core logic reproducible, separate test data from implementation and document assumptions before using the approach in production.

Run this example

python agent_policy.py

These are illustrative educational samples created for this portfolio, not employer-owned code or production-ready security controls.

LET'S CONNECT

Let’s build something with AI.

I welcome conversations about enterprise AI, strategic advisory, executive leadership and research collaboration.

puneett.bhatnagr@gmail.com
  • AI engineering and enterprise architecture
  • Responsible AI and model risk
  • Executive opportunities and consulting
  • Research and technical collaboration
TRUSTED AI BY DESIGN

Send me an inquiry

Tell me about your AI challenge, leadership opportunity or research idea.

Please do not include confidential business data. FormSubmit may ask you to complete a spam-prevention check.

Explore the portfolio

Search expertise, research, projects, articles and tools.