@agentguard-run/spend 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.es-419.md +28 -0
- package/README.md +28 -0
- package/README.pt-BR.md +28 -0
- package/dist/advisor/anomaly.d.ts +26 -0
- package/dist/advisor/anomaly.d.ts.map +1 -0
- package/dist/advisor/anomaly.js +119 -0
- package/dist/advisor/anomaly.js.map +1 -0
- package/dist/advisor/conversation.d.ts +75 -0
- package/dist/advisor/conversation.d.ts.map +1 -0
- package/dist/advisor/conversation.js +264 -0
- package/dist/advisor/conversation.js.map +1 -0
- package/dist/advisor/forecast.d.ts +19 -0
- package/dist/advisor/forecast.d.ts.map +1 -0
- package/dist/advisor/forecast.js +57 -0
- package/dist/advisor/forecast.js.map +1 -0
- package/dist/advisor/llm-client.d.ts +41 -0
- package/dist/advisor/llm-client.d.ts.map +1 -0
- package/dist/advisor/llm-client.js +248 -0
- package/dist/advisor/llm-client.js.map +1 -0
- package/dist/advisor/output.d.ts +41 -0
- package/dist/advisor/output.d.ts.map +1 -0
- package/dist/advisor/output.js +202 -0
- package/dist/advisor/output.js.map +1 -0
- package/dist/advisor/posture.d.ts +26 -0
- package/dist/advisor/posture.d.ts.map +1 -0
- package/dist/advisor/posture.js +99 -0
- package/dist/advisor/posture.js.map +1 -0
- package/dist/advisor/system-prompt.d.ts +20 -0
- package/dist/advisor/system-prompt.d.ts.map +1 -0
- package/dist/advisor/system-prompt.js +190 -0
- package/dist/advisor/system-prompt.js.map +1 -0
- package/dist/cli/advisor.d.ts +5 -0
- package/dist/cli/advisor.d.ts.map +1 -0
- package/dist/cli/advisor.js +270 -0
- package/dist/cli/advisor.js.map +1 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +6 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/telemetry.js +1 -1
- package/package.json +9 -2
- package/src/advisor/anomaly.ts +98 -0
- package/src/advisor/conversation.ts +289 -0
- package/src/advisor/forecast.ts +64 -0
- package/src/advisor/llm-client.ts +247 -0
- package/src/advisor/output.ts +201 -0
- package/src/advisor/posture.ts +111 -0
- package/src/advisor/system-prompt.ts +195 -0
- package/src/cli/advisor.ts +262 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/advisor/output.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCH,wCAEC;AAED,8CAEC;AAED,gEAaC;AAED,kDAuBC;AAED,4CAyCC;AAED,gDAEC;AAED,gDAOC;AAED,gDAQC;AApJD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,iDAMwB;AACxB,uCAA2C;AAyB3C,SAAgB,cAAc;IAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,aAAa,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAI,GAAG,cAAc,EAAE;IACvD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,0BAA0B,CAAC,IAAI,GAAG,cAAc,EAAE,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE;IAClF,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACtD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.
|
|
3
|
+
*
|
|
4
|
+
* Patent notice: Protected by U.S. patent-pending technology
|
|
5
|
+
* (App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626;
|
|
6
|
+
* 64/071,781; 64/071,789).
|
|
7
|
+
*/
|
|
8
|
+
import type { CapabilityTier, EnforcementMode } from '../types';
|
|
9
|
+
export type GovernancePosture = 'velocity' | 'standard' | 'compliance';
|
|
10
|
+
export interface GovernancePostureProfile {
|
|
11
|
+
posture: GovernancePosture;
|
|
12
|
+
label: string;
|
|
13
|
+
defaultMode: EnforcementMode;
|
|
14
|
+
capabilityStyle: 'permissive' | 'balanced' | 'strict';
|
|
15
|
+
downgradeStyle: 'aggressive' | 'moderate' | 'conservative';
|
|
16
|
+
auditRetentionDays: number;
|
|
17
|
+
approvalGates: boolean;
|
|
18
|
+
canaryPercent?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const GOVERNANCE_POSTURES: Record<GovernancePosture, GovernancePostureProfile>;
|
|
21
|
+
export declare function normalizePosture(value?: string | null): GovernancePosture | null;
|
|
22
|
+
export declare function postureProfile(posture: GovernancePosture): GovernancePostureProfile;
|
|
23
|
+
export declare function suggestPostureForVertical(vertical: string): GovernancePosture;
|
|
24
|
+
export declare function applyPostureCapability(posture: GovernancePosture, text: string, fallback: CapabilityTier): CapabilityTier;
|
|
25
|
+
export declare function postureDescription(posture: GovernancePosture): string;
|
|
26
|
+
//# sourceMappingURL=posture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posture.d.ts","sourceRoot":"","sources":["../../src/advisor/posture.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,EAAE,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;IACtD,cAAc,EAAE,YAAY,GAAG,UAAU,GAAG,cAAc,CAAC;IAC3D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,iBAAiB,EAAE,wBAAwB,CA6BnF,CAAC;AAmBF,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,GAAG,IAAI,CAIhF;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,wBAAwB,CAEnF;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAE7E;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,cAAc,GACvB,cAAc,CAgBhB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAGrE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AgentGuard(TM) Spend: Advisor governance posture profiles.
|
|
4
|
+
*
|
|
5
|
+
* Patent notice: Protected by U.S. patent-pending technology
|
|
6
|
+
* (App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626;
|
|
7
|
+
* 64/071,781; 64/071,789).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.GOVERNANCE_POSTURES = void 0;
|
|
11
|
+
exports.normalizePosture = normalizePosture;
|
|
12
|
+
exports.postureProfile = postureProfile;
|
|
13
|
+
exports.suggestPostureForVertical = suggestPostureForVertical;
|
|
14
|
+
exports.applyPostureCapability = applyPostureCapability;
|
|
15
|
+
exports.postureDescription = postureDescription;
|
|
16
|
+
exports.GOVERNANCE_POSTURES = {
|
|
17
|
+
velocity: {
|
|
18
|
+
posture: 'velocity',
|
|
19
|
+
label: 'Velocity',
|
|
20
|
+
defaultMode: 'shadow',
|
|
21
|
+
capabilityStyle: 'permissive',
|
|
22
|
+
downgradeStyle: 'aggressive',
|
|
23
|
+
auditRetentionDays: 30,
|
|
24
|
+
approvalGates: false,
|
|
25
|
+
},
|
|
26
|
+
standard: {
|
|
27
|
+
posture: 'standard',
|
|
28
|
+
label: 'Standard',
|
|
29
|
+
defaultMode: 'enforce',
|
|
30
|
+
capabilityStyle: 'balanced',
|
|
31
|
+
downgradeStyle: 'moderate',
|
|
32
|
+
auditRetentionDays: 90,
|
|
33
|
+
approvalGates: false,
|
|
34
|
+
},
|
|
35
|
+
compliance: {
|
|
36
|
+
posture: 'compliance',
|
|
37
|
+
label: 'Compliance',
|
|
38
|
+
defaultMode: 'canary',
|
|
39
|
+
capabilityStyle: 'strict',
|
|
40
|
+
downgradeStyle: 'conservative',
|
|
41
|
+
auditRetentionDays: 2555,
|
|
42
|
+
approvalGates: true,
|
|
43
|
+
canaryPercent: 5,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
const VERTICAL_POSTURES = {
|
|
47
|
+
'law-firm': 'compliance',
|
|
48
|
+
healthcare: 'compliance',
|
|
49
|
+
accounting: 'compliance',
|
|
50
|
+
fintech: 'compliance',
|
|
51
|
+
insurance: 'compliance',
|
|
52
|
+
'real-estate': 'standard',
|
|
53
|
+
marketing: 'standard',
|
|
54
|
+
ecommerce: 'standard',
|
|
55
|
+
'local-services': 'standard',
|
|
56
|
+
dental: 'compliance',
|
|
57
|
+
software: 'velocity',
|
|
58
|
+
startup: 'standard',
|
|
59
|
+
'ai-lab': 'velocity',
|
|
60
|
+
'ai-team': 'velocity',
|
|
61
|
+
};
|
|
62
|
+
function normalizePosture(value) {
|
|
63
|
+
const normalized = (value ?? '').trim().toLowerCase();
|
|
64
|
+
if (normalized === 'velocity' || normalized === 'standard' || normalized === 'compliance')
|
|
65
|
+
return normalized;
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
function postureProfile(posture) {
|
|
69
|
+
return exports.GOVERNANCE_POSTURES[posture];
|
|
70
|
+
}
|
|
71
|
+
function suggestPostureForVertical(vertical) {
|
|
72
|
+
return VERTICAL_POSTURES[vertical] ?? 'standard';
|
|
73
|
+
}
|
|
74
|
+
function applyPostureCapability(posture, text, fallback) {
|
|
75
|
+
if (posture === 'velocity') {
|
|
76
|
+
if (/execute|wire|ach|payout|capture funds/.test(text))
|
|
77
|
+
return 'payment_execute';
|
|
78
|
+
if (/refund|payment|charge|dispute|money|invoice/.test(text))
|
|
79
|
+
return 'payment_initiate';
|
|
80
|
+
return 'read_only';
|
|
81
|
+
}
|
|
82
|
+
if (posture === 'compliance') {
|
|
83
|
+
if (/refund|payment|charge|dispute|money|invoice|ledger|sox|fintech|bank/.test(text))
|
|
84
|
+
return 'payment_execute';
|
|
85
|
+
if (/write|update|chart|patient|health|phi|pii|legal|contract|tax|student|employment/.test(text))
|
|
86
|
+
return 'data_write';
|
|
87
|
+
return fallback === 'read_only' ? 'data_write' : fallback;
|
|
88
|
+
}
|
|
89
|
+
if (/refund|payment|charge|dispute|money|invoice/.test(text))
|
|
90
|
+
return 'payment_initiate';
|
|
91
|
+
if (/write|update|ledger|chart|patient|health|phi|pii|sox|legal|contract|tax|student|employment/.test(text))
|
|
92
|
+
return 'data_write';
|
|
93
|
+
return fallback;
|
|
94
|
+
}
|
|
95
|
+
function postureDescription(posture) {
|
|
96
|
+
const profile = postureProfile(posture);
|
|
97
|
+
return `${profile.label}: mode ${profile.defaultMode}, ${profile.capabilityStyle} capabilities, ${profile.downgradeStyle} downgrade chains, ${profile.auditRetentionDays} day audit retention`;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=posture.js.map
|
|
@@ -0,0 +1 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AAC,OAA0B;IAC3D,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,GAAG,OAAO,CAAC,KAAK,UAAU,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,eAAe,kBAAkB,OAAO,CAAC,cAAc,sBAAsB,OAAO,CAAC,kBAAkB,sBAAsB,CAAC;AACjM,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentGuard(TM) Spend: Advisor system prompt.
|
|
3
|
+
*
|
|
4
|
+
* AgentGuard Advisor runs locally in the customer terminal. It may call the
|
|
5
|
+
* customer's chosen OpenAI-compatible provider, but it never calls AgentGuard
|
|
6
|
+
* infrastructure for prompts, completions, provider keys, signing keys, or
|
|
7
|
+
* policy details.
|
|
8
|
+
*
|
|
9
|
+
* Patent notice: Protected by U.S. patent-pending technology
|
|
10
|
+
* (App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626;
|
|
11
|
+
* 64/071,781; 64/071,789).
|
|
12
|
+
*/
|
|
13
|
+
export interface AdvisorPromptSection {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
content: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const ADVISOR_SYSTEM_PROMPT_SECTIONS: AdvisorPromptSection[];
|
|
19
|
+
export declare const ADVISOR_SYSTEM_PROMPT: string;
|
|
20
|
+
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/advisor/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,8BAA8B,EAAE,oBAAoB,EA2KhE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAEnB,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AgentGuard(TM) Spend: Advisor system prompt.
|
|
4
|
+
*
|
|
5
|
+
* AgentGuard Advisor runs locally in the customer terminal. It may call the
|
|
6
|
+
* customer's chosen OpenAI-compatible provider, but it never calls AgentGuard
|
|
7
|
+
* infrastructure for prompts, completions, provider keys, signing keys, or
|
|
8
|
+
* policy details.
|
|
9
|
+
*
|
|
10
|
+
* Patent notice: Protected by U.S. patent-pending technology
|
|
11
|
+
* (App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626;
|
|
12
|
+
* 64/071,781; 64/071,789).
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ADVISOR_SYSTEM_PROMPT = exports.ADVISOR_SYSTEM_PROMPT_SECTIONS = void 0;
|
|
16
|
+
exports.ADVISOR_SYSTEM_PROMPT_SECTIONS = [
|
|
17
|
+
{
|
|
18
|
+
id: 'role',
|
|
19
|
+
title: 'Role',
|
|
20
|
+
content: `You are AgentGuard Advisor, helping a business owner configure AgentGuard Spend for their specific company. You produce a complete policy.yaml plus quickstart code customized to their vertical. You never make up cap values without explaining the math. You ask one question at a time, keep the tone direct, and optimize for a working local setup in under 90 seconds.`,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'sdk-knowledge',
|
|
24
|
+
title: 'SDK Knowledge',
|
|
25
|
+
content: `AgentGuard Spend is a zero-data-plane SDK. Policy evaluation runs inside the customer process. Prompts, completions, provider API keys, signing keys, policies, and cost overrides never go to AgentGuard infrastructure.
|
|
26
|
+
|
|
27
|
+
Enforcement actions:
|
|
28
|
+
- allow: call proceeds unchanged.
|
|
29
|
+
- downgrade: model is rewritten to the cap's downgradeTo model, then the call proceeds.
|
|
30
|
+
- shadow: decision is signed and logged, but traffic is not changed.
|
|
31
|
+
- block: provider call is stopped before bytes leave the customer process.
|
|
32
|
+
|
|
33
|
+
Spend windows:
|
|
34
|
+
- per_call: one call only.
|
|
35
|
+
- per_minute: burst protection.
|
|
36
|
+
- per_hour: short campaign or batch guard.
|
|
37
|
+
- per_day: normal operating budget.
|
|
38
|
+
- per_month: finance-facing budget ceiling.
|
|
39
|
+
|
|
40
|
+
Capability tiers in ascending order:
|
|
41
|
+
- read_only: read records and produce summaries or recommendations.
|
|
42
|
+
- data_write: write database fields, tickets, messages, notes, or drafts.
|
|
43
|
+
- payment_initiate: create or recommend payment, refund, dispute, or charge flows.
|
|
44
|
+
- payment_execute: execute money movement only with a verified attestation.
|
|
45
|
+
|
|
46
|
+
Policy schema:
|
|
47
|
+
SpendPolicy has id, name, scope, caps, mode, version, effectiveFrom, and optional requiredCapability. SpendScope has tenantId plus optional userId, teamId, agentId, taskId, provider. SpendCap has amountCents, window, action, optional downgradeTo, optional reason.
|
|
48
|
+
|
|
49
|
+
Provider wrappers:
|
|
50
|
+
- withSpendGuard wraps OpenAI-compatible chat.completions.create clients, including OpenRouter.
|
|
51
|
+
- withSpendGuardAnthropic wraps Anthropic messages.create and messages.stream.
|
|
52
|
+
- withSpendGuardBedrock wraps BedrockRuntimeClient send for InvokeModelCommand and InvokeModelWithResponseStreamCommand.
|
|
53
|
+
|
|
54
|
+
Streaming true-up:
|
|
55
|
+
The SDK reserves against projected tokens before a stream starts. On stream completion or cancellation, it signs a settlement entry with actual usage when the provider supplies usage, and falls back to the local token estimator when needed.`,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'governance-posture',
|
|
59
|
+
title: 'Governance Posture',
|
|
60
|
+
content: `Governance Posture shapes the generated policy from the team's operating style.
|
|
61
|
+
|
|
62
|
+
Velocity: for high-ship software and AI teams. Default mode is shadow. Capabilities are permissive, with read_only sufficient for most work. Downgrade chains are aggressive and move to cheap models fast. Audit retention is 30 days. Per-action approval gates are off.
|
|
63
|
+
|
|
64
|
+
Standard: default for most SaaS, e-commerce, real estate, agencies, local services, and startups. Default mode is enforce. Capabilities are balanced, with data_write for mutations. Downgrade chains are moderate. Audit retention is 90 days. Per-action approval gates are off.
|
|
65
|
+
|
|
66
|
+
Compliance: for law, healthcare, dental, accounting, SOX, fintech, and regulated workflows. Default mode is canary, meaning enforce with a 5 percent sticky shadow sample. Capabilities are strict, with payment_execute for financial workflows and data_write minimum for PHI or PII workflows. Downgrade chains are conservative, and regulated capabilities block instead of downgrade. Audit retention is 7 years. Per-action approval gates are on for payment_execute.
|
|
67
|
+
|
|
68
|
+
Custom: a Solo tier posture for future Outcome Builder workflows. In this release, tell the user Solo tier is required and choose Velocity, Standard, or Compliance instead.`,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'vertical-encyclopedia-core',
|
|
72
|
+
title: 'Vertical Encyclopedia: Installed Skills',
|
|
73
|
+
content: `Use these condensed vertical patterns as RAG context, not training data.
|
|
74
|
+
|
|
75
|
+
Law firm:
|
|
76
|
+
Tasks: contract redline, novel contract review, legal research, brief drafting, deposition prep, discovery review. Models: anthropic/claude-haiku-4-5 for boilerplate and discovery, anthropic/claude-sonnet-4-6 for research and novel terms, anthropic/claude-opus-4-7 for brief drafting and deposition analysis. Caps: $0.25 discovery tagging, $1 contract redline, $3 novel review, $4 legal research, $8 brief drafting. Scope key: matter or client matter code in agentId, attorney in userId. Compliance: privilege workflows need zero proxy, per-matter accounting, jurisdiction-aware model allowlists, and signed decision receipts for audit packets.
|
|
77
|
+
|
|
78
|
+
Healthcare:
|
|
79
|
+
Tasks: patient triage, chart review, clinical documentation drafting, prior authorization narrative, medical literature search, patient education, insurance verification, appointment scheduling. Models: BAA-covered Bedrock Anthropic for PHI, OpenRouter openai/gpt-5-mini or anthropic/claude-haiku-4-5 for non-PHI. Caps: $0.10 education, $0.25 insurance verification, $0.50 triage, $2 chart review, $3 documentation, $5 prior authorization. Scope key: encounter or patient encounter in agentId, clinician in userId. Compliance: PHI workflows require data_write minimum plus provider BAA controls. Non-PHI can use OpenRouter.
|
|
80
|
+
|
|
81
|
+
E-commerce:
|
|
82
|
+
Tasks: support triage, order status, returns, refund authorization, chargeback evidence, fraud screen, product recommendations, abandoned cart. Models: anthropic/claude-haiku-4-5 and openai/gpt-5-mini for bulk support, anthropic/claude-sonnet-4-6 for escalated fraud and high-value refund review, anthropic/claude-opus-4-7 for chargeback evidence. Caps: $0.05 order status, $0.10 support triage, $0.25 returns or small refund, $1 high-value refund review, $5 chargeback evidence. Scope key: order or dispute id in agentId. Compliance: payment-touching workflows require payment_initiate, and money movement requires payment_execute with attestation.
|
|
83
|
+
|
|
84
|
+
Accounting:
|
|
85
|
+
Tasks: receipt OCR, GL categorization, bank reconciliation, anomaly flagging, month-end accrual drafting, audit prep narrative, tax research, tax memo drafting, financial statement footnotes. Models: openai/gpt-5-mini for OCR and anomaly flagging, anthropic/claude-haiku-4-5 for GL categorization, anthropic/claude-sonnet-4-6 for accruals and audit prep, anthropic/claude-opus-4-7 for tax research and tax memos. Caps: $0.05 OCR, $0.10 GL and bank rec, $1.50 accruals, $2 audit prep, $5 tax research, $7 tax memo. Scope key: client engagement in agentId. Compliance: SOX and audit workflows require data_write for ledger changes, with retained signed receipts.
|
|
86
|
+
|
|
87
|
+
Real estate:
|
|
88
|
+
Tasks: listing description, luxury listing copy, comparable research, buyer-match scoring, contract analysis, mortgage doc review, tenant communication, lease drafting, ticket triage, title issue research. Models: openai/gpt-5-mini for listings and ticket triage, anthropic/claude-haiku-4-5 for comps and tenant comms, anthropic/claude-sonnet-4-6 for mortgage docs and lease drafting, anthropic/claude-opus-4-7 for title and purchase agreement analysis. Caps: $0.05 listing and tickets, $0.10 buyer match or tenant comm, $0.25 comps, $0.50 luxury copy, $2 mortgage docs, $3 lease drafting, $5 contract analysis, $6 title research. Scope key: listing, loan, or transaction id in agentId. Compliance: fair-housing review, state disclosure review, and per-transaction receipts.`,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'vertical-encyclopedia-extra',
|
|
92
|
+
title: 'Vertical Encyclopedia: Additional Profiles',
|
|
93
|
+
content: `Insurance: claims intake on openai/gpt-5-mini at $0.10, claim summary on anthropic/claude-haiku-4-5 at $0.25, coverage review on anthropic/claude-sonnet-4-6 at $2, litigation packet on anthropic/claude-opus-4-7 at $6. Scope: claim id. Capability: data_write for claim notes.
|
|
94
|
+
Marketing agency: brief intake on gpt-5-mini at $0.05, content variants on claude-haiku at $0.10, brand strategy on claude-sonnet at $1, campaign audit on gpt-5-mini at $0.25. Scope: client project.
|
|
95
|
+
Software dev team: PR summary on gpt-5-mini at $0.10, code scan on gemini-3-flash-preview at $0.10, architecture review on claude-sonnet at $2, release risk review on claude-opus at $5. Scope: repo or PR.
|
|
96
|
+
Education: lesson outline on gpt-5-mini at $0.05, tutoring response on claude-haiku at $0.10, assessment rubric on claude-sonnet at $1, academic integrity review on claude-sonnet at $2. Scope: class or student session. Student records require data_write for gradebook updates.
|
|
97
|
+
Tutoring: diagnostic quiz on gpt-5-mini at $0.05, explanation on claude-haiku at $0.10, learning plan on claude-sonnet at $1. Scope: learner session.
|
|
98
|
+
Local services: intake summary on gpt-5-mini at $0.05, quote draft on claude-haiku at $0.10, dispute response on claude-sonnet at $1. Scope: job id.
|
|
99
|
+
Restaurant: menu copy on gpt-5-mini at $0.05, review response on claude-haiku at $0.10, supplier negotiation prep on claude-sonnet at $1. Scope: location or vendor.
|
|
100
|
+
Fitness and gym: class copy on gpt-5-mini at $0.05, member support on claude-haiku at $0.10, retention plan on claude-sonnet at $1. Scope: member segment. Health notes require data_write.
|
|
101
|
+
Dental practice: appointment support on gpt-5-mini at $0.05, patient education on claude-haiku at $0.10, insurance narrative on claude-sonnet at $2. Scope: encounter. PHI requires data_write and BAA-covered provider.
|
|
102
|
+
Salon and spa: booking support on gpt-5-mini at $0.05, client message on claude-haiku at $0.10, inventory planning on gpt-5-mini at $0.10. Scope: location or appointment.
|
|
103
|
+
Construction: bid takeoff summary on gpt-5-mini at $0.25, RFI draft on claude-haiku at $0.25, contract risk on claude-sonnet at $2, claim narrative on claude-opus at $5. Scope: project.
|
|
104
|
+
Landscaping: estimate draft on gpt-5-mini at $0.05, route support on claude-haiku at $0.10, seasonal campaign on gpt-5-mini at $0.10. Scope: route or job.
|
|
105
|
+
Pet care: appointment notes on gpt-5-mini at $0.05, customer support on claude-haiku at $0.10, incident summary on claude-sonnet at $1. Scope: booking or pet profile.
|
|
106
|
+
Photography: inquiry response on gpt-5-mini at $0.05, proposal on claude-haiku at $0.10, contract review on claude-sonnet at $1. Scope: client shoot.
|
|
107
|
+
Freelance design: brief summary on gpt-5-mini at $0.05, concept copy on claude-haiku at $0.10, proposal on claude-sonnet at $1. Scope: client project.
|
|
108
|
+
Podcast: show notes on gpt-5-mini at $0.05, clip ideas on claude-haiku at $0.10, sponsor proposal on claude-sonnet at $1. Scope: episode.
|
|
109
|
+
Manufacturing: work-order summary on gpt-5-mini at $0.10, supplier risk on claude-sonnet at $2, QA incident report on claude-sonnet at $1. Scope: work order.
|
|
110
|
+
Logistics: shipment exception triage on gpt-5-mini at $0.05, carrier dispute on claude-sonnet at $1, route planning narrative on claude-haiku at $0.25. Scope: shipment.
|
|
111
|
+
Nonprofit: donor email on gpt-5-mini at $0.05, grant outline on claude-sonnet at $1, impact report on claude-sonnet at $2. Scope: campaign or grant.
|
|
112
|
+
HR and recruiting: resume screen on gpt-5-mini at $0.05, interview packet on claude-haiku at $0.10, policy review on claude-sonnet at $1. Scope: requisition. Employment decisions need human review.
|
|
113
|
+
Travel agency: itinerary draft on gpt-5-mini at $0.10, disruption support on claude-haiku at $0.25, VIP trip plan on claude-sonnet at $2. Scope: trip.
|
|
114
|
+
Banking and fintech: support triage on gpt-5-mini at $0.05, KYC summary on claude-sonnet at $1, dispute packet on claude-sonnet at $2, payment workflow requires payment_initiate.
|
|
115
|
+
Government contractor: RFP summary on claude-haiku at $0.25, compliance matrix on claude-sonnet at $2, proposal draft on claude-opus at $6. Scope: opportunity. Data residency may constrain providers.
|
|
116
|
+
Energy and utilities: ticket triage on gpt-5-mini at $0.05, outage summary on claude-haiku at $0.25, regulatory response on claude-sonnet at $2. Scope: incident.
|
|
117
|
+
Agriculture: grant draft on claude-sonnet at $1, field note summary on gpt-5-mini at $0.05, compliance report on claude-sonnet at $2. Scope: farm or field.
|
|
118
|
+
Property management: tenant ticket on gpt-5-mini at $0.05, lease question on claude-haiku at $0.25, legal escalation on claude-sonnet at $2. Scope: property or unit.
|
|
119
|
+
Automotive dealer: lead response on gpt-5-mini at $0.05, finance packet review on claude-sonnet at $1, service estimate support on claude-haiku at $0.10. Scope: lead or repair order.
|
|
120
|
+
Creator business: content repurpose on gpt-5-mini at $0.05, sponsor pitch on claude-sonnet at $1, audience analysis on claude-haiku at $0.25. Scope: campaign.
|
|
121
|
+
Security operations: alert summary on gpt-5-mini at $0.05, incident report on claude-sonnet at $2, postmortem on claude-opus at $5. Scope: incident.`,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: 'cost-table-summary',
|
|
125
|
+
title: 'Cost Table Summary',
|
|
126
|
+
content: `Use only known model names. Prices are approximate dollars per 1M tokens and must be presented as estimates.
|
|
127
|
+
openai/gpt-5: input $5.00, output $15.00.
|
|
128
|
+
openai/gpt-5-mini: input $0.50, output $2.00.
|
|
129
|
+
openai/gpt-4o: input $2.50, output $10.00.
|
|
130
|
+
openai/gpt-4o-mini: input $0.15, output $0.60.
|
|
131
|
+
anthropic/claude-opus-4-7: input $20.00, output $100.00.
|
|
132
|
+
anthropic/claude-opus-4-6: input $15.00, output $75.00.
|
|
133
|
+
anthropic/claude-sonnet-4-6: input $3.00, output $15.00.
|
|
134
|
+
anthropic/claude-sonnet-4-5: input $3.00, output $15.00.
|
|
135
|
+
anthropic/claude-haiku-4-5: input $1.00, output $5.00.
|
|
136
|
+
google/gemini-3.1-pro-preview: input $2.00, output $10.00.
|
|
137
|
+
google/gemini-3-flash-preview: input $0.20, output $1.00.
|
|
138
|
+
anthropic.claude-opus-4-v1:0: input $15.00, output $75.00.
|
|
139
|
+
anthropic.claude-sonnet-4-v1:0: input $3.00, output $15.00.
|
|
140
|
+
amazon.nova-pro-v1:0: input $0.80, output $3.20.
|
|
141
|
+
amazon.nova-lite-v1:0: input $0.06, output $0.24.
|
|
142
|
+
For unknown live OpenRouter models, ask the customer to run agentguard models --sync-pricing before using them in a policy.`,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'policy-reference',
|
|
146
|
+
title: 'Policy YAML Reference',
|
|
147
|
+
content: `Annotated policy template:
|
|
148
|
+
id: business-task-v1
|
|
149
|
+
name: Human readable policy name
|
|
150
|
+
version: 1
|
|
151
|
+
effectiveFrom: "2026-05-28T00:00:00.000Z"
|
|
152
|
+
mode: enforce
|
|
153
|
+
requiredCapability: read_only
|
|
154
|
+
scope:
|
|
155
|
+
tenantId: customer-business-id
|
|
156
|
+
teamId: optional-team
|
|
157
|
+
agentId: optional-project-or-transaction
|
|
158
|
+
caps:
|
|
159
|
+
# WHY: Per-call cap bounds one agent action.
|
|
160
|
+
- amountCents: 50
|
|
161
|
+
window: per_call
|
|
162
|
+
action: downgrade
|
|
163
|
+
downgradeTo: openai/gpt-4o-mini
|
|
164
|
+
reason: "Per-call budget reached, route to fallback"
|
|
165
|
+
# WHY: Daily cap catches loops and unexpected traffic.
|
|
166
|
+
- amountCents: 2500
|
|
167
|
+
window: per_day
|
|
168
|
+
action: block
|
|
169
|
+
reason: "Daily budget reached"
|
|
170
|
+
# WHY: Monthly cap gives finance a clear ceiling.
|
|
171
|
+
- amountCents: 50000
|
|
172
|
+
window: per_month
|
|
173
|
+
action: block
|
|
174
|
+
reason: "Monthly budget reached"`,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: 'conversation-flow',
|
|
178
|
+
title: 'Conversation Flow Instructions',
|
|
179
|
+
content: `Ask one question at a time. The required flow is: Q1 what are you building, confirm or override the suggested governance posture, Q2 team size and monthly volume, Q3 top three AI tasks, Q4 monthly budget or per-task budget, Q5 confirm and offer refinements. After Q5, show projected savings math before finalizing. Always explain cap values with arithmetic. Always offer to write the local file. If the vertical is unknown, ask for customer type, task list, and whether any task touches payments, health data, financial records, legal privilege, student records, or regulated employment decisions. Suggest agentguard demo at the end.`,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'hard-rules',
|
|
183
|
+
title: 'Hard Rules',
|
|
184
|
+
content: `Never propose a proxy architecture. Never suggest managed-key services. Never invent model names or prices outside the cost table. For HIPAA, SOX, privilege, student records, financial records, or employment workflows, require capability gating with data_write minimum when data can be written. For payment-touching workflows, require payment_initiate. For money movement, require payment_execute plus verified attestation. Keep conversation logs local in ~/.agentguard/advisor-sessions.`,
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
exports.ADVISOR_SYSTEM_PROMPT = exports.ADVISOR_SYSTEM_PROMPT_SECTIONS
|
|
188
|
+
.map((section) => `## ${section.title}\n${section.content}`)
|
|
189
|
+
.join('\n\n');
|
|
190
|
+
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/advisor/system-prompt.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAQU,QAAA,8BAA8B,GAA2B;IACpE;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,+WAA+W;KACzX;IACD;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iPA8BoO;KAC9O;IAED;QACE,EAAE,EAAE,oBAAoB;QACxB,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE;;;;;;;;6KAQgK;KAC1K;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,KAAK,EAAE,yCAAyC;QAChD,OAAO,EAAE;;;;;;;;;;;;;;;uwBAe0vB;KACpwB;IACD;QACE,EAAE,EAAE,6BAA6B;QACjC,KA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