1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "eventId": "evt-101",
14 "sessionId": "sess-44",
15 "agent": "procurement-agent",
16 "tool": "payments.create",
17 "action": "create_payment",
18 "resource": "vendor:acme",
19 "permission": "payments:write",
20 "approvalStatus": "missing",
21 "sideEffect": "financial",
22 "riskType": "unapproved_financial_action",
23 "riskScore": 92,
24 "sensitiveData": false,
25 "timestamp": "2026-09-20T14:04:00Z"
26 },
27 {
28 "eventId": "evt-102",
29 "sessionId": "sess-44",
30 "agent": "procurement-agent",
31 "tool": "crm.search",
32 "action": "read_contacts",
33 "resource": "crm:contacts",
34 "permission": "contacts:read",
35 "approvalStatus": "not_required",
36 "sideEffect": "read",
37 "riskType": "sensitive_data_access",
38 "riskScore": 48,
39 "sensitiveData": true,
40 "timestamp": "2026-09-20T14:04:04Z"
41 },
42 {
43 "eventId": "evt-103",
44 "sessionId": "sess-44",
45 "agent": "procurement-agent",
46 "tool": "shell.exec",
47 "action": "execute_command",
48 "resource": "host:worker-2",
49 "permission": "shell:execute",
50 "approvalStatus": "denied",
51 "sideEffect": "execution",
52 "riskType": "privilege_escalation_attempt",
53 "riskScore": 96,
54 "sensitiveData": false,
55 "timestamp": "2026-09-20T14:04:08Z"
56 }
57 ],
58 "previousItems": [
59 {
60 "eventId": "evt-091",
61 "sessionId": "sess-41",
62 "agent": "procurement-agent",
63 "tool": "crm.search",
64 "action": "read_contacts",
65 "resource": "crm:contacts",
66 "permission": "contacts:read",
67 "approvalStatus": "not_required",
68 "sideEffect": "read",
69 "riskType": "sensitive_data_access",
70 "riskScore": 35,
71 "sensitiveData": true,
72 "timestamp": "2026-09-13T14:04:04Z"
73 }
74 ]
75};
76
77
78const run = await client.actor("quanmatrix/ai-agent-runtime-risk-governance-intelligence").call(input);
79
80
81console.log('Results from dataset');
82console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
83const { items } = await client.dataset(run.defaultDatasetId).listItems();
84items.forEach((item) => {
85 console.dir(item);
86});
87
88