@weave_protocol/ward 0.1.0

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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Split a markdown body into a map of `{ "section name": "section body" }`
3
+ * keyed by H2 headings (`## Section Name`).
4
+ *
5
+ * The section name is normalized (lowercased, alphanumeric only) so that
6
+ * `## Multi-Agent` and `## multi agent` produce the same key.
7
+ */
8
+ export interface MarkdownSection {
9
+ /** Original heading text. */
10
+ title: string;
11
+ /** Normalized key. */
12
+ key: string;
13
+ /** Body of the section (content under the heading, up to the next H2). */
14
+ body: string;
15
+ }
16
+ export declare function splitSections(body: string): MarkdownSection[];
17
+ export declare function normalizeKey(title: string): string;
18
+ /**
19
+ * Extract a YAML-like block from a section body. Many WARD sections use the
20
+ * pattern of bare `key: value` and `-` list items inside markdown, optionally
21
+ * wrapped in a ```yaml fenced code block.
22
+ */
23
+ export declare function extractStructuredBlock(sectionBody: string): string;
24
+ //# sourceMappingURL=markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/parser/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE,CA6B7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAOlE"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Split a markdown body into a map of `{ "section name": "section body" }`
3
+ * keyed by H2 headings (`## Section Name`).
4
+ *
5
+ * The section name is normalized (lowercased, alphanumeric only) so that
6
+ * `## Multi-Agent` and `## multi agent` produce the same key.
7
+ */
8
+ export function splitSections(body) {
9
+ const lines = body.split("\n");
10
+ const sections = [];
11
+ let current = null;
12
+ let currentLines = [];
13
+ for (const line of lines) {
14
+ const h2Match = /^##\s+(.+?)\s*$/.exec(line);
15
+ if (h2Match) {
16
+ // Flush previous section
17
+ if (current) {
18
+ current.body = currentLines.join("\n").trim();
19
+ sections.push(current);
20
+ }
21
+ const title = h2Match[1].trim();
22
+ current = { title, key: normalizeKey(title), body: "" };
23
+ currentLines = [];
24
+ }
25
+ else if (current) {
26
+ currentLines.push(line);
27
+ }
28
+ // Lines before the first H2 are ignored (typically just the H1 title)
29
+ }
30
+ if (current) {
31
+ current.body = currentLines.join("\n").trim();
32
+ sections.push(current);
33
+ }
34
+ return sections;
35
+ }
36
+ export function normalizeKey(title) {
37
+ return title.toLowerCase().replace(/[^a-z0-9]+/g, "");
38
+ }
39
+ /**
40
+ * Extract a YAML-like block from a section body. Many WARD sections use the
41
+ * pattern of bare `key: value` and `-` list items inside markdown, optionally
42
+ * wrapped in a ```yaml fenced code block.
43
+ */
44
+ export function extractStructuredBlock(sectionBody) {
45
+ // Prefer explicit fenced yaml block if present
46
+ const fenced = /```ya?ml\s*\n([\s\S]*?)\n```/i.exec(sectionBody);
47
+ if (fenced)
48
+ return fenced[1];
49
+ // Otherwise just use the section body as-is. Strip code fences.
50
+ return sectionBody.replace(/```[^\n]*\n?/g, "").trim();
51
+ }
52
+ //# sourceMappingURL=markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/parser/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAsB,EAAE,CAAC;IACvC,IAAI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AAC;IACjE,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAE7B,gEAAgE;IAChE,OAAO,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Minimal YAML frontmatter extractor.
3
+ *
4
+ * We only support the subset of YAML actually used in WARD.md frontmatter:
5
+ * - scalar key: value pairs
6
+ * - quoted and unquoted strings
7
+ * - simple arrays [a, b, c]
8
+ * - block arrays with `-` items
9
+ *
10
+ * No anchors, no merge keys, no multi-doc. If users need richer YAML they
11
+ * can put it in markdown sections instead.
12
+ */
13
+ /** Extract frontmatter block from raw markdown. Returns body if no frontmatter. */
14
+ export declare function splitFrontmatter(source: string): {
15
+ frontmatter: string | null;
16
+ body: string;
17
+ };
18
+ /**
19
+ * Parse a simple YAML block into a JS object.
20
+ * Handles top-level keys and one level of nested block lists.
21
+ */
22
+ export declare function parseYAML(yaml: string): Record<string, unknown>;
23
+ //# sourceMappingURL=yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/parser/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG;IAChD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAiBA;AAyCD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2D/D"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Minimal YAML frontmatter extractor.
3
+ *
4
+ * We only support the subset of YAML actually used in WARD.md frontmatter:
5
+ * - scalar key: value pairs
6
+ * - quoted and unquoted strings
7
+ * - simple arrays [a, b, c]
8
+ * - block arrays with `-` items
9
+ *
10
+ * No anchors, no merge keys, no multi-doc. If users need richer YAML they
11
+ * can put it in markdown sections instead.
12
+ */
13
+ /** Extract frontmatter block from raw markdown. Returns body if no frontmatter. */
14
+ export function splitFrontmatter(source) {
15
+ if (!source.startsWith("---"))
16
+ return { frontmatter: null, body: source };
17
+ const lines = source.split("\n");
18
+ let endIdx = -1;
19
+ for (let i = 1; i < lines.length; i++) {
20
+ if (lines[i].trim() === "---" || lines[i].trim() === "...") {
21
+ endIdx = i;
22
+ break;
23
+ }
24
+ }
25
+ if (endIdx === -1)
26
+ return { frontmatter: null, body: source };
27
+ return {
28
+ frontmatter: lines.slice(1, endIdx).join("\n"),
29
+ body: lines.slice(endIdx + 1).join("\n"),
30
+ };
31
+ }
32
+ function unquote(s) {
33
+ s = s.trim();
34
+ if ((s.startsWith('"') && s.endsWith('"')) || (s.startsWith("'") && s.endsWith("'"))) {
35
+ return s.slice(1, -1);
36
+ }
37
+ return s;
38
+ }
39
+ function coerce(raw) {
40
+ const s = raw.trim();
41
+ if (s === "" || s === "~" || s === "null")
42
+ return null;
43
+ if (s === "true")
44
+ return true;
45
+ if (s === "false")
46
+ return false;
47
+ if (/^-?\d+$/.test(s))
48
+ return parseInt(s, 10);
49
+ if (/^-?\d+\.\d+$/.test(s))
50
+ return parseFloat(s);
51
+ // Inline array: [a, b, c]
52
+ if (s.startsWith("[") && s.endsWith("]")) {
53
+ const inner = s.slice(1, -1).trim();
54
+ if (inner === "")
55
+ return [];
56
+ return inner.split(",").map((part) => coerce(unquote(part)));
57
+ }
58
+ // Inline object: {key: value, ...} (rare in our spec but supported)
59
+ if (s.startsWith("{") && s.endsWith("}")) {
60
+ const inner = s.slice(1, -1).trim();
61
+ const obj = {};
62
+ if (inner === "")
63
+ return obj;
64
+ for (const pair of inner.split(",")) {
65
+ const colon = pair.indexOf(":");
66
+ if (colon === -1)
67
+ continue;
68
+ obj[unquote(pair.slice(0, colon).trim())] = coerce(unquote(pair.slice(colon + 1).trim()));
69
+ }
70
+ return obj;
71
+ }
72
+ return unquote(s);
73
+ }
74
+ /**
75
+ * Parse a simple YAML block into a JS object.
76
+ * Handles top-level keys and one level of nested block lists.
77
+ */
78
+ export function parseYAML(yaml) {
79
+ const result = {};
80
+ const lines = yaml.split("\n");
81
+ let i = 0;
82
+ while (i < lines.length) {
83
+ const line = lines[i];
84
+ const trimmed = line.trim();
85
+ if (trimmed === "" || trimmed.startsWith("#")) {
86
+ i++;
87
+ continue;
88
+ }
89
+ const indent = line.length - line.trimStart().length;
90
+ const colon = line.indexOf(":");
91
+ if (colon === -1) {
92
+ i++;
93
+ continue;
94
+ }
95
+ const key = line.slice(indent, colon).trim();
96
+ const rest = line.slice(colon + 1).trim();
97
+ // Top-level only for frontmatter (we don't try to handle deep nesting here)
98
+ if (indent !== 0) {
99
+ i++;
100
+ continue;
101
+ }
102
+ if (rest === "") {
103
+ // Could be a block list or block mapping starting on next line
104
+ const items = [];
105
+ let j = i + 1;
106
+ while (j < lines.length) {
107
+ const nextLine = lines[j];
108
+ const nextTrim = nextLine.trim();
109
+ if (nextTrim === "" || nextTrim.startsWith("#")) {
110
+ j++;
111
+ continue;
112
+ }
113
+ const nextIndent = nextLine.length - nextLine.trimStart().length;
114
+ if (nextIndent === 0)
115
+ break; // back to top level
116
+ if (nextTrim.startsWith("- ")) {
117
+ items.push(coerce(nextTrim.slice(2)));
118
+ j++;
119
+ continue;
120
+ }
121
+ // Not a list item — abort, treat key as empty
122
+ break;
123
+ }
124
+ result[key] = items;
125
+ i = j;
126
+ }
127
+ else {
128
+ result[key] = coerce(rest);
129
+ i++;
130
+ }
131
+ }
132
+ return result;
133
+ }
134
+ //# sourceMappingURL=yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.js","sourceRoot":"","sources":["../../src/parser/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mFAAmF;AACnF,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAI7C,IAAI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M,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACpB,CAAC,GAAG,CAAC,CAAC;QACR,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,EAAE,CAAC;QACN,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * @weave_protocol/ward - Type definitions
3
+ *
4
+ * A WARD.md file declares the security policy for an AI agent. It pairs
5
+ * with AGENTS.md (the agent's purpose) and SKILL.md (the agent's
6
+ * capabilities) to form the complete infrastructure-as-code definition
7
+ * for an agentic system.
8
+ *
9
+ * Structure:
10
+ * - YAML frontmatter for machine-readable metadata
11
+ * - Markdown sections for each policy domain
12
+ * - Each section parses to a typed sub-policy
13
+ */
14
+ export type WardVersion = "1.0";
15
+ /**
16
+ * Top-level parsed WARD policy.
17
+ */
18
+ export interface WardPolicy {
19
+ /** Spec version (always "1.0" for now). */
20
+ version: WardVersion;
21
+ /** Optional reference to an AGENTS.md file (relative path or ID). */
22
+ agent?: string;
23
+ /** Optional human-readable name for the policy. */
24
+ name?: string;
25
+ /** Optional description. */
26
+ description?: string;
27
+ /** Defines what the agent is permitted to do on the filesystem. */
28
+ filesystem?: FilesystemPolicy;
29
+ /** Defines what network endpoints the agent can reach. */
30
+ network?: NetworkPolicy;
31
+ /** Defines which tool/capability invocations are allowed. */
32
+ capabilities?: CapabilitiesPolicy;
33
+ /** Controls what kinds of data can leave the agent's boundary. */
34
+ dataBoundaries?: DataBoundariesPolicy;
35
+ /** Resource limits — iterations, runtime, spend, tokens. */
36
+ behavioral?: BehavioralPolicy;
37
+ /** Multi-agent trust and isolation rules. */
38
+ multiAgent?: MultiAgentPolicy;
39
+ /** Compliance frameworks that auto-apply additional rules. */
40
+ compliance?: CompliancePolicy;
41
+ /** Required verification/attestation parameters. */
42
+ verification?: VerificationPolicy;
43
+ /** Threat model declaration. */
44
+ threatModel?: ThreatModelPolicy;
45
+ /** What to do when policy is violated. */
46
+ incidentResponse?: IncidentResponsePolicy;
47
+ /** Any unrecognized sections preserved as raw text. */
48
+ raw?: Record<string, string>;
49
+ }
50
+ export interface FilesystemPolicy {
51
+ allow?: FilesystemRule[];
52
+ deny?: FilesystemRule[];
53
+ /** Default action when no rule matches. */
54
+ default?: "allow" | "deny";
55
+ }
56
+ export interface FilesystemRule {
57
+ /** Operation: read, write, execute, delete, list. */
58
+ op: FilesystemOp;
59
+ /** Glob pattern (e.g., "/workspace/**", "~/Documents/*.txt"). */
60
+ path: string;
61
+ }
62
+ export type FilesystemOp = "read" | "write" | "execute" | "delete" | "list";
63
+ export interface NetworkPolicy {
64
+ allow?: NetworkRule[];
65
+ deny?: NetworkRule[];
66
+ default?: "allow" | "deny";
67
+ }
68
+ export interface NetworkRule {
69
+ /** URL pattern with glob support (e.g., "https://api.company.com/**"). */
70
+ url: string;
71
+ /** Optional method restriction. */
72
+ methods?: HttpMethod[];
73
+ }
74
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
75
+ export interface CapabilitiesPolicy {
76
+ /** Tools that may be called. */
77
+ allow?: string[];
78
+ /** Tools that may NOT be called (overrides allow if conflicting). */
79
+ deny?: string[];
80
+ /** Tools that require human-in-the-loop approval before execution. */
81
+ requireApproval?: string[];
82
+ /** Default action when a tool is not listed. */
83
+ default?: "allow" | "deny";
84
+ }
85
+ export interface DataBoundariesPolicy {
86
+ /** Data classifications allowed to leave the agent. */
87
+ egressAllow?: DataClassification[];
88
+ /** Data classifications that must never leave the agent. */
89
+ egressDeny?: DataClassification[];
90
+ /** Redaction rules to apply to any outbound data. */
91
+ redact?: RedactionRule[];
92
+ }
93
+ export type DataClassification = "public" | "internal" | "confidential" | "secret" | "pii" | "phi" | "pci" | "credentials";
94
+ export interface RedactionRule {
95
+ /** Type of data to redact. */
96
+ type: DataClassification | string;
97
+ /** Replacement string (e.g., "[REDACTED]"). */
98
+ replacement?: string;
99
+ }
100
+ export interface BehavioralPolicy {
101
+ /** Max number of agent loop iterations. */
102
+ maxIterations?: number;
103
+ /** Max total runtime in seconds. */
104
+ maxRuntimeSeconds?: number;
105
+ /** Max cost in USD (uses provider's reported cost). */
106
+ maxCostUSD?: number;
107
+ /** Max total tokens consumed. */
108
+ maxTokens?: number;
109
+ /** Max number of tool invocations. */
110
+ maxToolCalls?: number;
111
+ /** Max number of distinct external services contacted. */
112
+ maxExternalServices?: number;
113
+ }
114
+ export interface MultiAgentPolicy {
115
+ /** Trust chain — which agents can hand work to this one, and vice versa. */
116
+ trustChain?: TrustChain;
117
+ /** Isolation level between this agent and others in the harness. */
118
+ isolation?: IsolationLevel;
119
+ /** Semantic drift threshold (0-1). If intent drifts more than this between
120
+ * agent handoffs, halt and require attestation. */
121
+ maxSemanticDrift?: number;
122
+ }
123
+ export interface TrustChain {
124
+ /** Agents that may invoke this agent. */
125
+ upstream?: string[];
126
+ /** Agents this agent may invoke. */
127
+ downstream?: string[];
128
+ }
129
+ export type IsolationLevel = "none" | "soft" | "strict" | "sandboxed";
130
+ export interface CompliancePolicy {
131
+ /** Frameworks to apply (auto-injects additional rules). */
132
+ frameworks?: ComplianceFramework[];
133
+ /** Required to use a specific compliance backend. */
134
+ backend?: "domere" | "custom";
135
+ }
136
+ export type ComplianceFramework = "soc2" | "hipaa" | "pci-dss" | "iso27001" | "gdpr" | "ccpa" | "fedramp" | "nist-csf";
137
+ export interface VerificationPolicy {
138
+ /** Whether attestation is required. */
139
+ required?: boolean;
140
+ /** Backend to use. */
141
+ backend?: "domere" | "custom";
142
+ /** Blockchain to anchor to. */
143
+ blockchain?: "solana" | "ethereum" | "polygon" | "none";
144
+ /** How often to attest. */
145
+ frequency?: AttestationFrequency;
146
+ /** Public key or DID for the attesting party. */
147
+ attestor?: string;
148
+ }
149
+ export type AttestationFrequency = "every_action" | "every_handoff" | "every_iteration" | "session_end" | "manual";
150
+ export interface ThreatModelPolicy {
151
+ /** Threats this policy is designed to defend against. */
152
+ inScope?: ThreatCategory[];
153
+ /** Threats explicitly NOT covered (informational). */
154
+ outOfScope?: ThreatCategory[];
155
+ }
156
+ export type ThreatCategory = "prompt_injection" | "data_exfil" | "credential_theft" | "supply_chain" | "model_extraction" | "jailbreak" | "tool_misuse" | "semantic_drift" | "emergent_behavior" | "side_channel" | "physical_attack" | "denial_of_service" | string;
157
+ export interface IncidentResponsePolicy {
158
+ /** Actions to take when a violation is detected. */
159
+ onViolation?: ViolationAction[];
160
+ /** Severity threshold above which to take action. */
161
+ severityThreshold?: ViolationSeverity;
162
+ }
163
+ export interface ViolationAction {
164
+ type: ViolationActionType;
165
+ /** Only apply this action for violations at or above this severity. */
166
+ minSeverity?: ViolationSeverity;
167
+ /** Optional target (email, webhook URL, etc.). */
168
+ target?: string;
169
+ }
170
+ export type ViolationActionType = "log" | "alert" | "terminate" | "rollback" | "attest_violation" | "notify_human" | "block_further";
171
+ export type ViolationSeverity = "low" | "medium" | "high" | "critical";
172
+ export interface ValidationResult {
173
+ valid: boolean;
174
+ errors: ValidationIssue[];
175
+ warnings: ValidationIssue[];
176
+ policy?: WardPolicy;
177
+ }
178
+ export interface ValidationIssue {
179
+ level: "error" | "warning";
180
+ section?: string;
181
+ message: string;
182
+ suggestion?: string;
183
+ }
184
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,OAAO,EAAE,WAAW,CAAC;IACrB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC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definitions
3
+ *
4
+ * A WARD.md file declares the security policy for an AI agent. It pairs
5
+ * with AGENTS.md (the agent's purpose) and SKILL.md (the agent's
6
+ * capabilities) to form the complete infrastructure-as-code definition
7
+ * for an agentic system.
8
+ *
9
+ * Structure:
10
+ * - YAML frontmatter for machine-readable metadata
11
+ * - Markdown sections for each policy domain
12
+ * - Each section parses to a typed sub-policy
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -0,0 +1,74 @@
1
+ ---
2
+ ward: "1.0"
3
+ agent: my-data-analyzer
4
+ name: Data Analyzer Security Policy
5
+ description: Read-only analytics agent that produces summary reports. No external network, no credential access.
6
+ ---
7
+
8
+ # WARD.md
9
+
10
+ Security policy for a basic read-only data analyzer.
11
+
12
+ ## Filesystem
13
+
14
+ allow:
15
+ - read: /workspace/input/**
16
+ - write: /workspace/output/**
17
+ - list: /workspace/**
18
+ deny:
19
+ - read: /workspace/secrets/**
20
+ - read: ~/.ssh/**
21
+ - read: ~/.aws/**
22
+ default: deny
23
+
24
+ ## Network
25
+
26
+ default: deny
27
+
28
+ ## Capabilities
29
+
30
+ allow:
31
+ - file_read
32
+ - file_write
33
+ - code_exec
34
+ deny:
35
+ - shell_exec
36
+ - ssh
37
+ - http_request
38
+ default: deny
39
+
40
+ ## Behavioral Limits
41
+
42
+ maxIterations: 50
43
+ maxRuntimeSeconds: 300
44
+ maxCostUSD: 5.00
45
+ maxTokens: 100000
46
+
47
+ ## Data Boundaries
48
+
49
+ egressDeny:
50
+ - credentials
51
+ - secret
52
+ - pii
53
+
54
+ ## Verification
55
+
56
+ required: true
57
+ backend: domere
58
+ blockchain: solana
59
+ frequency: session_end
60
+
61
+ ## Threat Model
62
+
63
+ inScope:
64
+ - prompt_injection
65
+ - data_exfil
66
+ - tool_misuse
67
+
68
+ ## Incident Response
69
+
70
+ onViolation:
71
+ - log
72
+ - alert
73
+ - terminate
74
+ severityThreshold: medium
@@ -0,0 +1,108 @@
1
+ ---
2
+ ward: "1.0"
3
+ agent: healthcare-records-assistant
4
+ name: HIPAA-Compliant Records Agent
5
+ description: Agent that handles patient records. HIPAA + SOC2. All PII/PHI access attested.
6
+ ---
7
+
8
+ # WARD.md
9
+
10
+ Compliance-first policy for an agent operating in a regulated healthcare
11
+ context. PHI access is permitted within strict boundaries, but every read,
12
+ write, and transfer is attested to the blockchain.
13
+
14
+ ## Filesystem
15
+
16
+ allow:
17
+ - read: /records/active/**
18
+ - read: /workspace/templates/**
19
+ - write: /workspace/output/**
20
+ deny:
21
+ - read: /records/archived/**
22
+ - read: ~/.ssh/**
23
+ - write: /records/**
24
+ - execute: "**"
25
+ default: deny
26
+
27
+ ## Network
28
+
29
+ allow:
30
+ - url: "https://ehr.hospital.internal/**"
31
+ methods: [GET, POST]
32
+ - url: "https://api.openai.com/v1/chat/**"
33
+ methods: [POST]
34
+ deny:
35
+ - url: "**"
36
+ default: deny
37
+
38
+ ## Capabilities
39
+
40
+ allow:
41
+ - file_read
42
+ - file_write
43
+ - ehr_query
44
+ requireApproval:
45
+ - phi_export
46
+ - record_modify
47
+ deny:
48
+ - shell_exec
49
+ - http_request
50
+ default: deny
51
+
52
+ ## Data Boundaries
53
+
54
+ egressAllow:
55
+ - public
56
+ - internal
57
+ egressDeny:
58
+ - phi
59
+ - pii
60
+ - credentials
61
+ - secret
62
+ redact:
63
+ - type: phi
64
+ replacement: "[REDACTED PHI]"
65
+ - type: pii
66
+ replacement: "[REDACTED PII]"
67
+
68
+ ## Behavioral Limits
69
+
70
+ maxIterations: 30
71
+ maxRuntimeSeconds: 180
72
+ maxCostUSD: 3.00
73
+ maxTokens: 50000
74
+ maxToolCalls: 25
75
+
76
+ ## Compliance
77
+
78
+ frameworks:
79
+ - hipaa
80
+ - soc2
81
+ - gdpr
82
+ backend: domere
83
+
84
+ ## Verification
85
+
86
+ required: true
87
+ backend: domere
88
+ blockchain: ethereum
89
+ frequency: every_action
90
+
91
+ ## Threat Model
92
+
93
+ inScope:
94
+ - prompt_injection
95
+ - data_exfil
96
+ - credential_theft
97
+ - tool_misuse
98
+ - semantic_drift
99
+
100
+ ## Incident Response
101
+
102
+ onViolation:
103
+ - log
104
+ - alert
105
+ - terminate
106
+ - attest_violation
107
+ - notify_human
108
+ severityThreshold: low