• bitcoinBitcoin(BTC)$63,950.00-2.50%
  • ethereumEthereum(ETH)$1,857.03-2.20%
  • tetherTether(USDT)$1.000.00%
  • binancecoinBNB(BNB)$565.24-0.80%
  • usd-coinUSDC(USDC)$1.000.00%
  • rippleXRP(XRP)$1.09-2.40%
  • solanaSolana(SOL)$73.96-2.90%
  • tronTRON(TRX)$0.329643-0.60%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.02-2.20%
  • whitebitWhiteBIT Coin(WBT)$55.77-2.10%
  • HyperliquidHyperliquid(HYPE)$57.90-2.90%
  • dogecoinDogecoin(DOGE)$0.069529-0.80%
  • USDSUSDS(USDS)$1.000.00%
  • RainRain(RAIN)$0.0140490.80%
  • leo-tokenLEO Token(LEO)$9.701.10%
  • zcashZcash(ZEC)$477.93-7.30%
  • moneroMonero(XMR)$366.472.20%
  • chainlinkChainlink(LINK)$8.29-3.20%
  • cardanoCardano(ADA)$0.162518-3.70%
  • stellarStellar(XLM)$0.176949-4.00%
  • daiDai(DAI)$1.000.00%
  • CantonCanton(CC)$0.118140-3.90%
  • bitcoin-cashBitcoin Cash(BCH)$209.89-1.40%
  • USD1USD1(USD1)$1.000.00%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.47-0.50%
  • Ethena USDeEthena USDe(USDE)$1.000.00%
  • litecoinLitecoin(LTC)$45.92-2.30%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • hedera-hashgraphHedera(HBAR)$0.069894-1.80%
  • Circle USYCCircle USYC(USYC)$1.130.00%
  • suiSui(SUI)$0.71-5.50%
  • avalanche-2Avalanche(AVAX)$6.28-0.80%
  • paypal-usdPayPal USD(PYUSD)$1.000.00%
  • crypto-com-chainCronos(CRO)$0.056525-1.20%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • shiba-inuShiba Inu(SHIB)$0.0000040.70%
  • tether-goldTether Gold(XAUT)$4,049.280.10%
  • nearNEAR Protocol(NEAR)$1.79-6.00%
  • uniswapUniswap(UNI)$3.65-4.90%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.14-0.30%
  • OndoOndo(ONDO)$0.377906-6.60%
  • BittensorBittensor(TAO)$189.61-2.50%
  • World Liberty FinancialWorld Liberty Financial(WLFI)$0.0567470.70%
  • pax-goldPAX Gold(PAXG)$4,047.740.20%
  • okbOKB(OKB)$82.25-0.30%
  • AsterAster(ASTER)$0.62-0.60%
  • HTX DAOHTX DAO(HTX)$0.000002-1.10%
  • Ripple USDRipple USD(RLUSD)$1.000.00%
  • MemeCoreMemeCore(M)$1.192.60%
  • usddUSDD(USDD)$1.000.00%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

An Implementation of the Microsoft Agent Governance Toolkit for Safe AI Agent Tool Use with Policies, Approvals, Audit Logs, and Risk Controls

May 31, 2026
in AI & Technology
Reading Time: 3 mins read
A A
An Implementation of the Microsoft Agent Governance Toolkit for Safe AI Agent Tool Use with Policies, Approvals, Audit Logs, and Risk Controls
ShareShareShareShareShare

YOU MAY ALSO LIKE

Building Self-Evolving AI Agents with OpenSpace Using Skills, MCP, Lineage, and Low-Cost Reuse

Datalab Marker v2 vs MinerU, Docling, and Liteparse: Benchmark Breakdown

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
       })
   except Exception as e:
       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 in test_cases:
   decision = engine.evaluate(
       identity=test["identity"],
       tool_name=test["tool_name"],
       action=test["action"]
   )
   passed = decision.decision == test["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"
   )
except Exception as e:
   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()
G = nx.DiGraph()
for _, row in audit_df.iterrows():
   agent_node = 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 pd.notna(row["matched_rule"]) else "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)

Credit: Source link

ShareTweetSendSharePin

Related Posts

Building Self-Evolving AI Agents with OpenSpace Using Skills, MCP, Lineage, and Low-Cost Reuse
AI & Technology

Building Self-Evolving AI Agents with OpenSpace Using Skills, MCP, Lineage, and Low-Cost Reuse

July 25, 2026
Datalab Marker v2 vs MinerU, Docling, and Liteparse: Benchmark Breakdown
AI & Technology

Datalab Marker v2 vs MinerU, Docling, and Liteparse: Benchmark Breakdown

July 25, 2026
Datalab’s Marker 2 vs MinerU, Docling and LiteParse: 76.0 on olmOCR-bench at 5× MinerU’s Throughput
AI & Technology

Datalab’s Marker 2 vs MinerU, Docling and LiteParse: 76.0 on olmOCR-bench at 5× MinerU’s Throughput

July 25, 2026
Meta Has Pulled Out Of A Renewable Energy Initiative As It Relies More On Natural Gas For Data Centers
AI & Technology

Meta Has Pulled Out Of A Renewable Energy Initiative As It Relies More On Natural Gas For Data Centers

July 24, 2026
Next Post
MSI’s Claw 8 EX AI+ Handheld Comes Out On June 23

MSI's Claw 8 EX AI+ Handheld Comes Out On June 23

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
The First UL 3700-Compliant Plug-In Solar Microinverter Is Now Available In The US

The First UL 3700-Compliant Plug-In Solar Microinverter Is Now Available In The US

July 20, 2026
Tesla reports Q2 earnings miss but beats on revenue; cash burn rate less than expected – Yahoo Finance

Tesla reports Q2 earnings miss but beats on revenue; cash burn rate less than expected – Yahoo Finance

July 22, 2026
Stop adding more GPUs: Weka’s new storage platform reduces load by caching 100% of an AI model’s pre-calculated tokens

Stop adding more GPUs: Weka’s new storage platform reduces load by caching 100% of an AI model’s pre-calculated tokens

July 21, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!