Close Menu
  • AI
  • Content Creation
  • Tech
  • Robotics
AI-trends.todayAI-trends.today
  • AI
  • Content Creation
  • Tech
  • Robotics
Trending
  • Potential Cognition AI Spherical Would Elevate $2B-Plus at $75B Valuation – Unite.AI
  • OpenRouter Cuts Three Suppliers After AI Immediate Publicity Findings – Unite.AI
  • A Group of Researchers from Columbia and CertiK Introduce TensorLean for Formal Verification of GPU Kernels
  • Collectively AI Discloses Immediate Leak After Coding Agent Uncovered Credential – Unite.AI
  • Dragos Finds Immediate Leaks and Stolen Keys in AI Provide Chains
  • Lean and Mathlib Communities Certify Claude-Assisted Riemann Proof – Unite.AI
  • AWS Routes HyperPod Inference Throughout Areas From One Endpoint – Unite.AI
  • DailyAI Briefing: A Lean-checked Riemann proof, plus 4 extra
AI-trends.todayAI-trends.today
Home»Tech»Microsoft Agent Tool Governance Implementation with Policy, Approvals and Audit Logs for Safe AI Agent Tool Usage

Microsoft Agent Tool Governance Implementation with Policy, Approvals and Audit Logs for Safe AI Agent Tool Usage

Tech By Gavin Wallace31/05/20263 Mins Read
Facebook Twitter LinkedIn Email
NVIDIA Introduces ProRL: Long-Horizon Reinforcement Learning Boosts Reasoning and Generalization
NVIDIA Introduces ProRL: Long-Horizon Reinforcement Learning Boosts Reasoning and Generalization
Share
Facebook Twitter LinkedIn Email
scenarios = [
   {
       "name": "Safe database read",
       "tool": research_db,
       "kwargs": {
           "table": "customers",
           "operation": "select",
           "type": "select",
           "sensitivity": "medium"
       }
   },
   {
       "name": "Blocked destructive database action",
       "tool": research_db,
       "kwargs": {
           "table": "customers",
           "operation": "drop",
           "type": "drop_table",
           "sensitivity": "critical"
       }
   },
   {
       "name": "External email requiring approval",
       "tool": research_email,
       "kwargs": {
           "to": "[email protected]",
           "recipient_domain": "example.com",
           "subject": "Quarterly update",
           "body": "Sharing a non-confidential quarterly update.",
           "type": "send_email",
           "sensitivity": "medium"
       }
   },
   {
       "name": "External email denied due to approval rejection",
       "tool": research_email,
       "kwargs": {
           "to": "[email protected]",
           "recipient_domain": "example.com",
           "subject": "Confidential strategy",
           "body": "This contains confidential strategy.",
           "type": "send_email",
           "sensitivity": "critical"
       }
   },
   {
       "name": "Safe sandbox shell command",
       "tool": ops_shell,
       "kwargs": {
           "command": "echo Agent governance is active",
           "type": "shell_exec",
           "sensitivity": "low"
       }
   },
   {
       "name": "Dangerous shell command blocked",
       "tool": ops_shell,
       "kwargs": {
           "command": "rm -rf /content/something",
           "type": "shell_exec",
           "sensitivity": "critical"
       }
   },
   {
       "name": "Low-trust agent blocked from sensitive data",
       "tool": shadow_db,
       "kwargs": {
           "table": "executive_compensation",
           "operation": "select",
           "type": "select",
           "sensitivity": "critical"
       }
   },
   {
       "name": "Financial transfer requiring approval",
       "tool": finance_transfer,
       "kwargs": {
           "amount": 2500,
           "destination": "vendor-123",
           "type": "transfer_money",
           "sensitivity": "high"
       }
   },
   {
       "name": "Large financial transfer rejected",
       "tool": finance_transfer,
       "kwargs": {
           "amount": 15000,
           "destination": "vendor-999",
           "type": "transfer_money",
           "sensitivity": "critical"
       }
   },
]
Results = []
for scenario in scenarios:
   try:
       output = scenario["tool"](**scenario["kwargs"])
       results.append({
           "scenario": scenario["name"],
           "status": "executed",
           "output"Output
       })
 Exception to the rule:
       results.append({
           "scenario": scenario["name"],
           "status": "blocked_or_pending",
           "error": str(e)
       })
audit_df = audit_log.to_dataframe()
display_cols = [
   "timestamp",
   "agent_name",
   "tool_name",
   "decision",
   "matched_rule",
   "severity",
   "reason",
   "record_hash"
]
display(audit_df[display_cols])
test_cases = [
   {
       "name": "drop_table must be denied",
       "identity": research_agent,
       "tool_name": "query_database",
       "action": {"type": "drop_table", "sensitivity": "critical", "autonomous": True},
       "expected": "deny"
   },
   {
       "name": "safe select should be allowed",
       "identity": research_agent,
       "tool_name": "query_database",
       "action": {"type": "select", "sensitivity": "low", "autonomous": True},
       "expected": "allow"
   },
   {
       "name": "external email should require approval",
       "identity": research_agent,
       "tool_name": "send_email",
       "action": {
           "type": "send_email",
           "recipient_domain": "example.com",
           "sensitivity": "medium",
           "autonomous": True
       },
       "expected": "require_approval"
   },
   {
       "name": "low trust sensitive access denied",
       "identity": unknown_agent,
       "tool_name": "query_database",
       "action": {"type": "select", "sensitivity": "critical", "autonomous": True},
       "expected": "deny"
   },
   {
       "name": "shell command should enter sandbox",
       "identity": ops_agent,
       "tool_name": "shell_exec",
       "action": {
           "type": "shell_exec",
           "command": "echo hello",
           "sensitivity": "low",
           "autonomous": True
       },
       "expected": "sandbox"
   },
]
test_results = []
For test_cases in:
   decision = engine.evaluate(
       identity=test["identity"],
       tool_name=test["tool_name"],
       action=test["action"]
   )
 Test = decision.["expected"]
   test_results.append({
       "test"Test["name"],
       "expected"Test["expected"],
       "actual": decision.decision,
       "passed": passed,
       "matched_rule": decision.matched_rule
   })
test_df = pd.DataFrame(test_results)
display(test_df)
engine.activate_kill_switch()
try:
   research_db(
       table="customers",
       operation="select",
       type="select",
       sensitivity="low"
   )
Only Exceptions as follows:
   pass
engine.deactivate_kill_switch()
audit_df = audit_log.to_dataframe()
Summary =
   audit_df
   .groupby(["decision", "severity"], dropna=False)
   .size()
   .reset_index(name="count")
   .sort_values("count", ascending=False)
)
display(summary)
agent_summary = (
   audit_df
   .groupby(["agent_name", "decision"])
   .size()
   .reset_index(name="count")
   .sort_values(["agent_name", "count"], ascending=[True, False])
)
display(agent_summary)
decision_counts = audit_df["decision"].value_counts()
plt.figure(figsize=(8, 5))
decision_counts.plot(kind="bar")
plt.title("Governance Decisions Across Agent Actions")
plt.xlabel("Decision")
plt.ylabel("Count")
plt.xticks(rotation=30)
plt.tight_layout()
plt.show()
severity_counts = audit_df["severity"].fillna("none").value_counts()
plt.figure(figsize=(8, 5))
severity_counts.plot(kind="bar")
plt.title("Governance Events by Severity")
plt.xlabel("Severity")
plt.ylabel("Count")
plt.xticks(rotation=30)
plt.tight_layout()
plt.show()
Digraph: G = (nx)()
For _ row in audit_df.iterrows():
 Agent_node is equal to f"Agent: {row['agent_name']}"
 Tool_node = F"Tool: {row['tool_name']}"
   decision_node = f"Decision: {row['decision']}"
   rule_node = f"Rule: {row['matched_rule']}" If row.pd.notna["matched_rule"]If ( ) then "Rule: default"
   G.add_node(agent_node, node_type="agent")
   G.add_node(tool_node, node_type="tool")
   G.add_node(decision_node, node_type="decision")
   G.add_node(rule_node, node_type="rule")
   G.add_edge(agent_node, tool_node, relation="calls")
   G.add_edge(tool_node, decision_node, relation="produces")
   G.add_edge(decision_node, rule_node, relation="matched")
plt.figure(figsize=(14, 9))
pos = nx.spring_layout(G, seed=42, k=0.8)
nx.draw_networkx_nodes(G, pos, node_size=1800)
nx.draw_networkx_edges(G, pos, arrows=True, arrowstyle="->", arrowsize=15)
nx.draw_networkx_labels(G, pos, font_size=8)
plt.title("Agent Governance Graph: Agents, Tools, Decisions, and Policy Rules")
plt.axis("off")
plt.tight_layout()
plt.show()
EXPORT_DIR = "/content/agt_tutorial_outputs"
os.makedirs(EXPORT_DIR, exist_ok=True)
audit_json_path = os.path.join(EXPORT_DIR, "tamper_evident_audit_log.json")
audit_csv_path = os.path.join(EXPORT_DIR, "governance_audit_log.csv")
policy_copy_path = os.path.join(EXPORT_DIR, "advanced_agent_policy.yaml")
test_results_path = os.path.join(EXPORT_DIR, "policy_test_results.csv")
with open(audit_json_path, "w"As f:
   json.dump([asdict(r) for r in audit_log.records], f, indent=2, default=str)
audit_df.to_csv(audit_csv_path, index=False)
test_df.to_csv(test_results_path, index=False)
shutil.copy(POLICY_PATH, policy_copy_path)
AI microsoft Policy
Share. Facebook Twitter LinkedIn Email
Avatar
Gavin Wallace

Related Posts

A Group of Researchers from Columbia and CertiK Introduce TensorLean for Formal Verification of GPU Kernels

22/11/2026

OpenAI Ships GPT-Stay-1.1 for Voice Brokers, Cuts Idle Value to $0.02/Min

21/11/2026

Meet Pondering Machines Inkling 2 Mini: 26B Looped MoE Runs on a 32GB Mac

21/11/2026

Baseten Releases Bison-1 and Groundhog-1, Topping Choice Mannequin Index

21/11/2026
Top News

I Gave My Blood to the AI Loss of life Clock

Meet the AI Brokers Attempting to Be Actual-Life Journalists

Seven Ways To Get so Good At AI People Will Believe You Are AI

The DOGE used AI to help with housing policy The government won’t say how

Alex Karp Stated He’s a ‘Progressive.’ OK! Right here’s Some Different Stuff He’s Stated Lately

Load More
AI-Trends.Today

Your daily source of AI news and trends. Stay up to date with everything AI and automation!

X (Twitter) Instagram
Top Insights

Exa Launches Agent Extremely: A Subagent Swarm Deep Analysis API Constructed for Exhaustive Checklist Constructing

26/09/2026

Nvidia’s Board Has No Plans to Convey Again Jensen Huang

17/11/2026
Latest News

Potential Cognition AI Spherical Would Elevate $2B-Plus at $75B Valuation – Unite.AI

22/11/2026

OpenRouter Cuts Three Suppliers After AI Immediate Publicity Findings – Unite.AI

22/11/2026
X (Twitter) Instagram
  • Privacy Policy
  • Contact Us
  • Terms and Conditions
© 2026 AI-Trends.Today

Type above and press Enter to search. Press Esc to cancel.