protect-mcp 0.7.3 → 0.7.5
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 +48 -0
- package/README.md +155 -7
- package/dist/{bundle-XTR3YMPO.mjs → bundle-YUUHAG7O.mjs} +1 -1
- package/dist/{chunk-G67NUBML.mjs → chunk-6E2DHBAR.mjs} +21 -6
- package/dist/chunk-JCMDLN5I.mjs +1053 -0
- package/dist/{chunk-LYKNULYU.mjs → chunk-LJQOALYR.mjs} +152 -0
- package/dist/{chunk-5JXFV37Y.mjs → chunk-PM2ZO57M.mjs} +10 -2
- package/dist/{chunk-J6L4XCTE.mjs → chunk-SETXVE2K.mjs} +77 -2
- package/dist/{chunk-OHUTUFTC.mjs → chunk-VTPZ4G5I.mjs} +19 -15
- package/dist/{chunk-546U3A7R.mjs → chunk-WIPWNWMJ.mjs} +93 -2
- package/dist/chunk-WV4DKYE4.mjs +486 -0
- package/dist/cli.js +4609 -546
- package/dist/cli.mjs +2215 -40
- package/dist/demo-server.d.mts +3 -0
- package/dist/demo-server.d.ts +3 -0
- package/dist/demo-server.js +77 -2
- package/dist/demo-server.mjs +1 -1
- package/dist/{ed25519-DZMMNNVE.mjs → ed25519-BSHMMVNX.mjs} +1 -1
- package/dist/hook-server.js +128 -24
- package/dist/hook-server.mjs +2 -2
- package/dist/{http-transport-R5AO7X6D.mjs → http-transport-JBORN27G.mjs} +3 -3
- package/dist/index.d.mts +158 -10
- package/dist/index.d.ts +158 -10
- package/dist/index.js +2704 -108
- package/dist/index.mjs +1208 -261
- package/dist/receipt-registry-6CAOY6RP.mjs +279 -0
- package/dist/signing-committed-QXCW24RF.mjs +15 -0
- package/package.json +2 -2
- package/dist/chunk-ZBKJANP7.mjs +0 -145
package/dist/index.d.mts
CHANGED
|
@@ -190,6 +190,18 @@ interface DecisionLog {
|
|
|
190
190
|
plan_receipt_id?: string;
|
|
191
191
|
/** Hook event that triggered this log entry */
|
|
192
192
|
hook_event?: HookEventName;
|
|
193
|
+
/** Redacted exact-action readback shown to humans before approving */
|
|
194
|
+
action_readback?: {
|
|
195
|
+
tool: string;
|
|
196
|
+
action: string;
|
|
197
|
+
destination?: string;
|
|
198
|
+
payload_preview: unknown;
|
|
199
|
+
payload_hash: string;
|
|
200
|
+
payload_bytes: number;
|
|
201
|
+
disclosed_fields: string[];
|
|
202
|
+
redacted_fields: string[];
|
|
203
|
+
summary: string;
|
|
204
|
+
};
|
|
193
205
|
/** IETF specification version — ties every receipt to the standard */
|
|
194
206
|
spec?: string;
|
|
195
207
|
/** Issuer certification level:
|
|
@@ -977,6 +989,31 @@ interface MinimalDisclosure {
|
|
|
977
989
|
/** Merkle inclusion proof. */
|
|
978
990
|
proof: MerkleProof;
|
|
979
991
|
}
|
|
992
|
+
interface SelectiveDisclosurePackageV0 {
|
|
993
|
+
type: 'scopeblind.selective_disclosure.v0';
|
|
994
|
+
version: 0;
|
|
995
|
+
parent_receipt_hash: string;
|
|
996
|
+
committed_fields_root: string;
|
|
997
|
+
disclosed_fields: string[];
|
|
998
|
+
hidden_fields: string[];
|
|
999
|
+
disclosures: MinimalDisclosure[];
|
|
1000
|
+
verifier_explanation: {
|
|
1001
|
+
summary: string;
|
|
1002
|
+
disclosed: string;
|
|
1003
|
+
hidden: string;
|
|
1004
|
+
limitation: string;
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
interface SelectiveDisclosureVerification {
|
|
1008
|
+
valid: boolean;
|
|
1009
|
+
receipt_hash_valid: boolean;
|
|
1010
|
+
signature_valid: boolean | null;
|
|
1011
|
+
commitment_root_valid: boolean;
|
|
1012
|
+
disclosed_fields: string[];
|
|
1013
|
+
hidden_fields: string[];
|
|
1014
|
+
errors: string[];
|
|
1015
|
+
explanation: string[];
|
|
1016
|
+
}
|
|
980
1017
|
/**
|
|
981
1018
|
* Sign a DecisionLog in commitment mode.
|
|
982
1019
|
*
|
|
@@ -1007,6 +1044,8 @@ declare function signCommittedDecision(entry: DecisionLog, committedFieldNames:
|
|
|
1007
1044
|
* @standard draft-farley-acta-signed-receipts-01 §commitment-disclosure
|
|
1008
1045
|
*/
|
|
1009
1046
|
declare function discloseField(receiptHash: string, fieldName: string, openings: Record<string, CommittedFieldOpening>): MinimalDisclosure;
|
|
1047
|
+
declare function createSelectiveDisclosurePackage(receipt: Record<string, unknown>, fieldNames: string[], openings: Record<string, CommittedFieldOpening>): SelectiveDisclosurePackageV0;
|
|
1048
|
+
declare function verifySelectiveDisclosurePackage(receipt: Record<string, unknown>, disclosure: SelectiveDisclosurePackageV0): SelectiveDisclosureVerification;
|
|
1010
1049
|
|
|
1011
1050
|
/**
|
|
1012
1051
|
* @scopeblind/protect-mcp — External PDP Adapter
|
|
@@ -1076,6 +1115,8 @@ interface AuditBundleOptions {
|
|
|
1076
1115
|
receipts: Record<string, unknown>[];
|
|
1077
1116
|
/** Optional audit anchors */
|
|
1078
1117
|
anchors?: Record<string, unknown>[];
|
|
1118
|
+
/** Optional selective-disclosure packages opening selected committed fields */
|
|
1119
|
+
selectiveDisclosures?: SelectiveDisclosurePackageV0[];
|
|
1079
1120
|
/** JWK signing keys used by the receipts */
|
|
1080
1121
|
signingKeys: Array<{
|
|
1081
1122
|
kty: string;
|
|
@@ -1096,6 +1137,14 @@ interface AuditBundle {
|
|
|
1096
1137
|
} | null;
|
|
1097
1138
|
receipts: Record<string, unknown>[];
|
|
1098
1139
|
anchors: Record<string, unknown>[];
|
|
1140
|
+
selective_disclosures: SelectiveDisclosurePackageV0[];
|
|
1141
|
+
privacy: {
|
|
1142
|
+
selective_disclosure: {
|
|
1143
|
+
supported: true;
|
|
1144
|
+
model: 'salted_commitments_merkle_v0';
|
|
1145
|
+
statement: string;
|
|
1146
|
+
};
|
|
1147
|
+
};
|
|
1099
1148
|
verification: {
|
|
1100
1149
|
algorithm: 'ed25519';
|
|
1101
1150
|
signing_keys: Array<{
|
|
@@ -1620,6 +1669,77 @@ declare function generateCedarSchema(tools: McpToolDescription[], config?: Schem
|
|
|
1620
1669
|
*/
|
|
1621
1670
|
declare function generateSchemaStub(namespace?: string): string;
|
|
1622
1671
|
|
|
1672
|
+
interface PolicyPack {
|
|
1673
|
+
id: string;
|
|
1674
|
+
name: string;
|
|
1675
|
+
description: string;
|
|
1676
|
+
recommendedMode: 'shadow-first' | 'enforce-ready';
|
|
1677
|
+
files: Array<{
|
|
1678
|
+
path: string;
|
|
1679
|
+
contents: string;
|
|
1680
|
+
}>;
|
|
1681
|
+
}
|
|
1682
|
+
declare const POLICY_PACKS: PolicyPack[];
|
|
1683
|
+
declare function getPolicyPack(id: string): PolicyPack | undefined;
|
|
1684
|
+
declare function policyPackIds(): string[];
|
|
1685
|
+
|
|
1686
|
+
type ConnectorPilotId = 'github' | 'email-gmail' | 'filesystem-git' | 'slack-teams' | 'finance-pms' | 'nautilus-trader';
|
|
1687
|
+
interface ConnectorEnvVar {
|
|
1688
|
+
name: string;
|
|
1689
|
+
required: boolean;
|
|
1690
|
+
description: string;
|
|
1691
|
+
}
|
|
1692
|
+
interface ConnectorAction {
|
|
1693
|
+
name: string;
|
|
1694
|
+
tool: string;
|
|
1695
|
+
risk: 'low' | 'medium' | 'high';
|
|
1696
|
+
mode: 'observe' | 'require_approval' | 'deny';
|
|
1697
|
+
description: string;
|
|
1698
|
+
}
|
|
1699
|
+
interface ConnectorArtifact {
|
|
1700
|
+
path: string;
|
|
1701
|
+
contents: string;
|
|
1702
|
+
executable?: boolean;
|
|
1703
|
+
}
|
|
1704
|
+
interface ConnectorPilot {
|
|
1705
|
+
id: ConnectorPilotId;
|
|
1706
|
+
category: string;
|
|
1707
|
+
name: string;
|
|
1708
|
+
status: 'usable-pilot';
|
|
1709
|
+
description: string;
|
|
1710
|
+
value: string;
|
|
1711
|
+
env: ConnectorEnvVar[];
|
|
1712
|
+
tools: string[];
|
|
1713
|
+
actions: ConnectorAction[];
|
|
1714
|
+
setup: string[];
|
|
1715
|
+
config: Record<string, unknown>;
|
|
1716
|
+
cedar: string;
|
|
1717
|
+
artifacts?: ConnectorArtifact[];
|
|
1718
|
+
}
|
|
1719
|
+
interface InstalledConnectorPilot {
|
|
1720
|
+
id: string;
|
|
1721
|
+
name: string;
|
|
1722
|
+
category: string;
|
|
1723
|
+
status: string;
|
|
1724
|
+
config_path: string;
|
|
1725
|
+
policy_path: string;
|
|
1726
|
+
}
|
|
1727
|
+
declare const CONNECTOR_PILOTS: ConnectorPilot[];
|
|
1728
|
+
declare function connectorPilotIds(): ConnectorPilotId[];
|
|
1729
|
+
declare function getConnectorPilot(id: string): ConnectorPilot | undefined;
|
|
1730
|
+
declare function connectorDirectory(dir: string): string;
|
|
1731
|
+
declare function writeConnectorPilots(opts: {
|
|
1732
|
+
dir: string;
|
|
1733
|
+
ids?: string[];
|
|
1734
|
+
force?: boolean;
|
|
1735
|
+
}): {
|
|
1736
|
+
written: string[];
|
|
1737
|
+
pilots: ConnectorPilot[];
|
|
1738
|
+
directory: string;
|
|
1739
|
+
};
|
|
1740
|
+
declare function readInstalledConnectorPilots(dir: string): InstalledConnectorPilot[];
|
|
1741
|
+
declare function connectorDoctor(dir: string, env?: NodeJS.ProcessEnv): Array<Record<string, unknown>>;
|
|
1742
|
+
|
|
1623
1743
|
/**
|
|
1624
1744
|
* Sigstore Rekor Transparency Log Anchoring
|
|
1625
1745
|
*
|
|
@@ -2052,6 +2172,29 @@ interface ApprovalResult {
|
|
|
2052
2172
|
contextHash: string;
|
|
2053
2173
|
/** Timestamp of approval */
|
|
2054
2174
|
approvedAt: string;
|
|
2175
|
+
/** On failure, a machine-readable reason (e.g. 'invalid_signature'). */
|
|
2176
|
+
reason?: string;
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* The registered credential public key, extracted from the COSE_Key at
|
|
2180
|
+
* registration. ES256 keys are an uncompressed P-256 point; EdDSA keys are a
|
|
2181
|
+
* 32-byte Ed25519 public key.
|
|
2182
|
+
*/
|
|
2183
|
+
interface CredentialPublicKey {
|
|
2184
|
+
/** COSE algorithm: -7 = ES256 (P-256 / ECDSA), -8 = EdDSA (Ed25519). */
|
|
2185
|
+
alg: -7 | -8;
|
|
2186
|
+
/** Public key, hex. ES256: 65-byte uncompressed point (0x04 || x || y). EdDSA: 32-byte key. */
|
|
2187
|
+
publicKeyHex: string;
|
|
2188
|
+
}
|
|
2189
|
+
interface VerifyAssertionOptions {
|
|
2190
|
+
/** Allowed origin(s) the assertion must come from, e.g. 'https://app.scopeblind.com'. Defaults to https://<rpId>. */
|
|
2191
|
+
expectedOrigin?: string | string[];
|
|
2192
|
+
/** Require the UV (user-verified / biometric or PIN) flag. Default true. */
|
|
2193
|
+
requireUserVerification?: boolean;
|
|
2194
|
+
/** The signCount stored from the previous assertion; a non-increasing counter signals a cloned authenticator. */
|
|
2195
|
+
prevSignCount?: number;
|
|
2196
|
+
/** Override 'now' (ms) for testing. */
|
|
2197
|
+
now?: number;
|
|
2055
2198
|
}
|
|
2056
2199
|
/**
|
|
2057
2200
|
* Create a WebAuthn challenge for approving a tool call.
|
|
@@ -2088,17 +2231,22 @@ declare function toCredentialRequestOptions(challenge: ApprovalChallenge, allowC
|
|
|
2088
2231
|
};
|
|
2089
2232
|
};
|
|
2090
2233
|
/**
|
|
2091
|
-
* Verify a WebAuthn assertion
|
|
2092
|
-
*
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
2234
|
+
* Verify a WebAuthn assertion: full, fail-closed verification of a passkey or
|
|
2235
|
+
* security-key co-sign. This proves a SPECIFIC human authorized a SPECIFIC
|
|
2236
|
+
* action with a hardware-held key the host operator cannot exfiltrate. It
|
|
2237
|
+
* checks, in order: challenge freshness; clientDataJSON type, challenge, and
|
|
2238
|
+
* origin; the rpIdHash; the UP (and, by default, UV) flags; the authenticator
|
|
2239
|
+
* signature over authenticatorData || SHA-256(clientDataJSON) using the
|
|
2240
|
+
* registered credential public key (ES256 or EdDSA); and signCount monotonicity
|
|
2241
|
+
* (clone detection) when a previous count is supplied. Any failure returns
|
|
2242
|
+
* valid:false with a reason; nothing is trusted on a partial check.
|
|
2096
2243
|
*
|
|
2097
|
-
* @param challenge -
|
|
2098
|
-
* @param assertion -
|
|
2099
|
-
* @
|
|
2244
|
+
* @param challenge - the original challenge
|
|
2245
|
+
* @param assertion - the assertion from navigator.credentials.get()
|
|
2246
|
+
* @param credentialPublicKey - the registered public key for assertion.credentialId
|
|
2247
|
+
* @param opts - origin / UV / signCount / clock options
|
|
2100
2248
|
*/
|
|
2101
|
-
declare function verifyApprovalAssertion(challenge: ApprovalChallenge, assertion: ApprovalAssertion): ApprovalResult;
|
|
2249
|
+
declare function verifyApprovalAssertion(challenge: ApprovalChallenge, assertion: ApprovalAssertion, credentialPublicKey?: CredentialPublicKey, opts?: VerifyAssertionOptions): ApprovalResult;
|
|
2102
2250
|
/**
|
|
2103
2251
|
* Create the approval receipt payload for embedding in an Acta receipt.
|
|
2104
2252
|
*
|
|
@@ -3015,4 +3163,4 @@ declare function getScopeBlindBridge(): ScopeBlindBridge;
|
|
|
3015
3163
|
/** Convenience: forward a signed receipt without instantiating yourself. */
|
|
3016
3164
|
declare function forwardReceipt(signedReceipt: any): void;
|
|
3017
3165
|
|
|
3018
|
-
export { type ActionReceipt, type AdmissionResult, type AgentId, type AgentManifest, type ApprovalAssertion, type ApprovalChallenge, type ApprovalNotification, type ApprovalResult, type ArenaPayload, type ArenaReceipt, type AttestationDocument, type AttestationPayload, type AttestationProvider, type AttestationReceipt, type AttestationResult, type AuditBundle, type AuditBundleOptions, type BenchmarkPayload, type BenchmarkReceipt, type BuilderId, type C2PAAssertion, type C2PAIngredient, type C2PAManifest, type C2PAOptions, type CCRConnectorConfig, type CCRSessionContext, type CalibrationScore, type CedarEvalOptions, type CedarEvalRequest, type CedarPolicySet, type CedarSchema, type CedarSchemaResult, type CommittedFieldOpening, type CommittedSignResult, type ComplianceReport, ConfidentialGate, type ConfidentialGateConfig, type ConfidentialInferenceConfig, type CredentialConfig, type DecisionContext, type DecisionLog, type DelegationReceipt, type DisclosureMode, type Ed25519PublicKey, type EvidenceAttestation, type EvidenceAttestationInput, type EvidenceIssuer, type EvidenceReceipt, type EvidenceReceiptBase, type EvidenceSummary, type EvidenceSummaryEntry, type EvidenceType, type ExternalDecision, type ExternalPDPConfig, type HFDatasetMetadata, type HFReceiptRow, type HookEventName, type HookInput, type HookResponse, type IssuerType, type JsonRpcRequest, type JsonRpcResponse, type LeaseCompatibility, type ManifestBuilder, type ManifestCapabilities, type ManifestConfig, type ManifestIdentity, type ManifestPresentation, type ManifestSignature, type ManifestStatus, type McpToolDescription, type MinimalDisclosure, type NotificationConfig, type PassportTokenClaims, type PayloadDigest, type PlanReceipt, type PolicyEngineMode, type PredictionReceipt, type PredictionResolution, type PropagatorConfig, type ProtectConfig, ProtectGateway, type ProtectPolicy, type RateLimit, ReceiptPropagator, type RedactedResult, type RedactionSalt, type RekorAnchor, type RekorVerification, type RestraintPayload, type RestraintReceipt, type SHA256Hash, type SafetyTranscript, type Sandbox, type SandboxConfig, type SandboxReceipt, type SandboxResult, type SandboxToolCall, type SchemaGeneratorConfig, ScopeBlindBridge, type SelfTestCase, type SelfTestReport, type SigningConfig, type SimulationResult, type SimulationSummary, type SwarmContext, type TierOverrides, type TimingMetrics, type ToolPolicy, type TrustTier, type WorkPayload, type WorkReceipt, anchorToRekor, buildDecisionContext, checkRateLimit, collectSignedReceipts, computeCalibration, confidentialInference, createApprovalChallenge, createApprovalReceiptPayload, createAttestationField, createAuditBundle, createC2PAManifest, createDisclosurePackage, createEvidenceAttestation, createLogAnchorField, createReceiptChannel, createSandbox, destroySandbox, discloseField, ed25519ToDIDKey, evaluateCedar, evaluateTier, exportC2PAManifestJSON, exportJSONL, formatReportMarkdown, formatSimulation, forwardReceipt, generateC2PACommand, generateCedarSchema, generateDatasetCard, generateHFMetadata, generateReport, generateSafetyTranscript, generateSchemaStub, getScopeBlindBridge, getSignerInfo, getToolPolicy, hashReceipt, hashResponseBody, initSigning, isAgentId, isCedarAvailable, isDisclosureMode, isEvidenceType, isManifestStatus, isSigningEnabled, listCredentialLabels, loadCedarPolicies, loadPolicy, manifestToVC, meetsMinTier, parseLogFile, parseNotificationConfigFromEnv, parseRateLimit, policySetFromSource, queryExternalPDP, receiptToVP, receiptsToHFRows, redactFields, resolveCredential, revealField, runEvaluatorSelfTest, runInSandbox, sendApprovalNotification, signCommittedDecision, signDecision, simulate, toCredentialRequestOptions, toManifoldFormat, toMetaculusFormat, validateCredentials, validateEvidenceReceipt, validateManifest, verifyActaC2PAAssertions, verifyAllCommitments, verifyApprovalAssertion, verifyCommitment, verifyEvidenceAttestation, verifyRekorAnchor };
|
|
3166
|
+
export { type ActionReceipt, type AdmissionResult, type AgentId, type AgentManifest, type ApprovalAssertion, type ApprovalChallenge, type ApprovalNotification, type ApprovalResult, type ArenaPayload, type ArenaReceipt, type AttestationDocument, type AttestationPayload, type AttestationProvider, type AttestationReceipt, type AttestationResult, type AuditBundle, type AuditBundleOptions, type BenchmarkPayload, type BenchmarkReceipt, type BuilderId, type C2PAAssertion, type C2PAIngredient, type C2PAManifest, type C2PAOptions, type CCRConnectorConfig, type CCRSessionContext, CONNECTOR_PILOTS, type CalibrationScore, type CedarEvalOptions, type CedarEvalRequest, type CedarPolicySet, type CedarSchema, type CedarSchemaResult, type CommittedFieldOpening, type CommittedSignResult, type ComplianceReport, ConfidentialGate, type ConfidentialGateConfig, type ConfidentialInferenceConfig, type ConnectorAction, type ConnectorEnvVar, type ConnectorPilot, type ConnectorPilotId, type CredentialConfig, type DecisionContext, type DecisionLog, type DelegationReceipt, type DisclosureMode, type Ed25519PublicKey, type EvidenceAttestation, type EvidenceAttestationInput, type EvidenceIssuer, type EvidenceReceipt, type EvidenceReceiptBase, type EvidenceSummary, type EvidenceSummaryEntry, type EvidenceType, type ExternalDecision, type ExternalPDPConfig, type HFDatasetMetadata, type HFReceiptRow, type HookEventName, type HookInput, type HookResponse, type InstalledConnectorPilot, type IssuerType, type JsonRpcRequest, type JsonRpcResponse, type LeaseCompatibility, type ManifestBuilder, type ManifestCapabilities, type ManifestConfig, type ManifestIdentity, type ManifestPresentation, type ManifestSignature, type ManifestStatus, type McpToolDescription, type MinimalDisclosure, type NotificationConfig, POLICY_PACKS, type PassportTokenClaims, type PayloadDigest, type PlanReceipt, type PolicyEngineMode, type PolicyPack, type PredictionReceipt, type PredictionResolution, type PropagatorConfig, type ProtectConfig, ProtectGateway, type ProtectPolicy, type RateLimit, ReceiptPropagator, type RedactedResult, type RedactionSalt, type RekorAnchor, type RekorVerification, type RestraintPayload, type RestraintReceipt, type SHA256Hash, type SafetyTranscript, type Sandbox, type SandboxConfig, type SandboxReceipt, type SandboxResult, type SandboxToolCall, type SchemaGeneratorConfig, ScopeBlindBridge, type SelectiveDisclosurePackageV0, type SelectiveDisclosureVerification, type SelfTestCase, type SelfTestReport, type SigningConfig, type SimulationResult, type SimulationSummary, type SwarmContext, type TierOverrides, type TimingMetrics, type ToolPolicy, type TrustTier, type WorkPayload, type WorkReceipt, anchorToRekor, buildDecisionContext, checkRateLimit, collectSignedReceipts, computeCalibration, confidentialInference, connectorDirectory, connectorDoctor, connectorPilotIds, createApprovalChallenge, createApprovalReceiptPayload, createAttestationField, createAuditBundle, createC2PAManifest, createDisclosurePackage, createEvidenceAttestation, createLogAnchorField, createReceiptChannel, createSandbox, createSelectiveDisclosurePackage, destroySandbox, discloseField, ed25519ToDIDKey, evaluateCedar, evaluateTier, exportC2PAManifestJSON, exportJSONL, formatReportMarkdown, formatSimulation, forwardReceipt, generateC2PACommand, generateCedarSchema, generateDatasetCard, generateHFMetadata, generateReport, generateSafetyTranscript, generateSchemaStub, getConnectorPilot, getPolicyPack, getScopeBlindBridge, getSignerInfo, getToolPolicy, hashReceipt, hashResponseBody, initSigning, isAgentId, isCedarAvailable, isDisclosureMode, isEvidenceType, isManifestStatus, isSigningEnabled, listCredentialLabels, loadCedarPolicies, loadPolicy, manifestToVC, meetsMinTier, parseLogFile, parseNotificationConfigFromEnv, parseRateLimit, policyPackIds, policySetFromSource, queryExternalPDP, readInstalledConnectorPilots, receiptToVP, receiptsToHFRows, redactFields, resolveCredential, revealField, runEvaluatorSelfTest, runInSandbox, sendApprovalNotification, signCommittedDecision, signDecision, simulate, toCredentialRequestOptions, toManifoldFormat, toMetaculusFormat, validateCredentials, validateEvidenceReceipt, validateManifest, verifyActaC2PAAssertions, verifyAllCommitments, verifyApprovalAssertion, verifyCommitment, verifyEvidenceAttestation, verifyRekorAnchor, verifySelectiveDisclosurePackage, writeConnectorPilots };
|
package/dist/index.d.ts
CHANGED
|
@@ -190,6 +190,18 @@ interface DecisionLog {
|
|
|
190
190
|
plan_receipt_id?: string;
|
|
191
191
|
/** Hook event that triggered this log entry */
|
|
192
192
|
hook_event?: HookEventName;
|
|
193
|
+
/** Redacted exact-action readback shown to humans before approving */
|
|
194
|
+
action_readback?: {
|
|
195
|
+
tool: string;
|
|
196
|
+
action: string;
|
|
197
|
+
destination?: string;
|
|
198
|
+
payload_preview: unknown;
|
|
199
|
+
payload_hash: string;
|
|
200
|
+
payload_bytes: number;
|
|
201
|
+
disclosed_fields: string[];
|
|
202
|
+
redacted_fields: string[];
|
|
203
|
+
summary: string;
|
|
204
|
+
};
|
|
193
205
|
/** IETF specification version — ties every receipt to the standard */
|
|
194
206
|
spec?: string;
|
|
195
207
|
/** Issuer certification level:
|
|
@@ -977,6 +989,31 @@ interface MinimalDisclosure {
|
|
|
977
989
|
/** Merkle inclusion proof. */
|
|
978
990
|
proof: MerkleProof;
|
|
979
991
|
}
|
|
992
|
+
interface SelectiveDisclosurePackageV0 {
|
|
993
|
+
type: 'scopeblind.selective_disclosure.v0';
|
|
994
|
+
version: 0;
|
|
995
|
+
parent_receipt_hash: string;
|
|
996
|
+
committed_fields_root: string;
|
|
997
|
+
disclosed_fields: string[];
|
|
998
|
+
hidden_fields: string[];
|
|
999
|
+
disclosures: MinimalDisclosure[];
|
|
1000
|
+
verifier_explanation: {
|
|
1001
|
+
summary: string;
|
|
1002
|
+
disclosed: string;
|
|
1003
|
+
hidden: string;
|
|
1004
|
+
limitation: string;
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
interface SelectiveDisclosureVerification {
|
|
1008
|
+
valid: boolean;
|
|
1009
|
+
receipt_hash_valid: boolean;
|
|
1010
|
+
signature_valid: boolean | null;
|
|
1011
|
+
commitment_root_valid: boolean;
|
|
1012
|
+
disclosed_fields: string[];
|
|
1013
|
+
hidden_fields: string[];
|
|
1014
|
+
errors: string[];
|
|
1015
|
+
explanation: string[];
|
|
1016
|
+
}
|
|
980
1017
|
/**
|
|
981
1018
|
* Sign a DecisionLog in commitment mode.
|
|
982
1019
|
*
|
|
@@ -1007,6 +1044,8 @@ declare function signCommittedDecision(entry: DecisionLog, committedFieldNames:
|
|
|
1007
1044
|
* @standard draft-farley-acta-signed-receipts-01 §commitment-disclosure
|
|
1008
1045
|
*/
|
|
1009
1046
|
declare function discloseField(receiptHash: string, fieldName: string, openings: Record<string, CommittedFieldOpening>): MinimalDisclosure;
|
|
1047
|
+
declare function createSelectiveDisclosurePackage(receipt: Record<string, unknown>, fieldNames: string[], openings: Record<string, CommittedFieldOpening>): SelectiveDisclosurePackageV0;
|
|
1048
|
+
declare function verifySelectiveDisclosurePackage(receipt: Record<string, unknown>, disclosure: SelectiveDisclosurePackageV0): SelectiveDisclosureVerification;
|
|
1010
1049
|
|
|
1011
1050
|
/**
|
|
1012
1051
|
* @scopeblind/protect-mcp — External PDP Adapter
|
|
@@ -1076,6 +1115,8 @@ interface AuditBundleOptions {
|
|
|
1076
1115
|
receipts: Record<string, unknown>[];
|
|
1077
1116
|
/** Optional audit anchors */
|
|
1078
1117
|
anchors?: Record<string, unknown>[];
|
|
1118
|
+
/** Optional selective-disclosure packages opening selected committed fields */
|
|
1119
|
+
selectiveDisclosures?: SelectiveDisclosurePackageV0[];
|
|
1079
1120
|
/** JWK signing keys used by the receipts */
|
|
1080
1121
|
signingKeys: Array<{
|
|
1081
1122
|
kty: string;
|
|
@@ -1096,6 +1137,14 @@ interface AuditBundle {
|
|
|
1096
1137
|
} | null;
|
|
1097
1138
|
receipts: Record<string, unknown>[];
|
|
1098
1139
|
anchors: Record<string, unknown>[];
|
|
1140
|
+
selective_disclosures: SelectiveDisclosurePackageV0[];
|
|
1141
|
+
privacy: {
|
|
1142
|
+
selective_disclosure: {
|
|
1143
|
+
supported: true;
|
|
1144
|
+
model: 'salted_commitments_merkle_v0';
|
|
1145
|
+
statement: string;
|
|
1146
|
+
};
|
|
1147
|
+
};
|
|
1099
1148
|
verification: {
|
|
1100
1149
|
algorithm: 'ed25519';
|
|
1101
1150
|
signing_keys: Array<{
|
|
@@ -1620,6 +1669,77 @@ declare function generateCedarSchema(tools: McpToolDescription[], config?: Schem
|
|
|
1620
1669
|
*/
|
|
1621
1670
|
declare function generateSchemaStub(namespace?: string): string;
|
|
1622
1671
|
|
|
1672
|
+
interface PolicyPack {
|
|
1673
|
+
id: string;
|
|
1674
|
+
name: string;
|
|
1675
|
+
description: string;
|
|
1676
|
+
recommendedMode: 'shadow-first' | 'enforce-ready';
|
|
1677
|
+
files: Array<{
|
|
1678
|
+
path: string;
|
|
1679
|
+
contents: string;
|
|
1680
|
+
}>;
|
|
1681
|
+
}
|
|
1682
|
+
declare const POLICY_PACKS: PolicyPack[];
|
|
1683
|
+
declare function getPolicyPack(id: string): PolicyPack | undefined;
|
|
1684
|
+
declare function policyPackIds(): string[];
|
|
1685
|
+
|
|
1686
|
+
type ConnectorPilotId = 'github' | 'email-gmail' | 'filesystem-git' | 'slack-teams' | 'finance-pms' | 'nautilus-trader';
|
|
1687
|
+
interface ConnectorEnvVar {
|
|
1688
|
+
name: string;
|
|
1689
|
+
required: boolean;
|
|
1690
|
+
description: string;
|
|
1691
|
+
}
|
|
1692
|
+
interface ConnectorAction {
|
|
1693
|
+
name: string;
|
|
1694
|
+
tool: string;
|
|
1695
|
+
risk: 'low' | 'medium' | 'high';
|
|
1696
|
+
mode: 'observe' | 'require_approval' | 'deny';
|
|
1697
|
+
description: string;
|
|
1698
|
+
}
|
|
1699
|
+
interface ConnectorArtifact {
|
|
1700
|
+
path: string;
|
|
1701
|
+
contents: string;
|
|
1702
|
+
executable?: boolean;
|
|
1703
|
+
}
|
|
1704
|
+
interface ConnectorPilot {
|
|
1705
|
+
id: ConnectorPilotId;
|
|
1706
|
+
category: string;
|
|
1707
|
+
name: string;
|
|
1708
|
+
status: 'usable-pilot';
|
|
1709
|
+
description: string;
|
|
1710
|
+
value: string;
|
|
1711
|
+
env: ConnectorEnvVar[];
|
|
1712
|
+
tools: string[];
|
|
1713
|
+
actions: ConnectorAction[];
|
|
1714
|
+
setup: string[];
|
|
1715
|
+
config: Record<string, unknown>;
|
|
1716
|
+
cedar: string;
|
|
1717
|
+
artifacts?: ConnectorArtifact[];
|
|
1718
|
+
}
|
|
1719
|
+
interface InstalledConnectorPilot {
|
|
1720
|
+
id: string;
|
|
1721
|
+
name: string;
|
|
1722
|
+
category: string;
|
|
1723
|
+
status: string;
|
|
1724
|
+
config_path: string;
|
|
1725
|
+
policy_path: string;
|
|
1726
|
+
}
|
|
1727
|
+
declare const CONNECTOR_PILOTS: ConnectorPilot[];
|
|
1728
|
+
declare function connectorPilotIds(): ConnectorPilotId[];
|
|
1729
|
+
declare function getConnectorPilot(id: string): ConnectorPilot | undefined;
|
|
1730
|
+
declare function connectorDirectory(dir: string): string;
|
|
1731
|
+
declare function writeConnectorPilots(opts: {
|
|
1732
|
+
dir: string;
|
|
1733
|
+
ids?: string[];
|
|
1734
|
+
force?: boolean;
|
|
1735
|
+
}): {
|
|
1736
|
+
written: string[];
|
|
1737
|
+
pilots: ConnectorPilot[];
|
|
1738
|
+
directory: string;
|
|
1739
|
+
};
|
|
1740
|
+
declare function readInstalledConnectorPilots(dir: string): InstalledConnectorPilot[];
|
|
1741
|
+
declare function connectorDoctor(dir: string, env?: NodeJS.ProcessEnv): Array<Record<string, unknown>>;
|
|
1742
|
+
|
|
1623
1743
|
/**
|
|
1624
1744
|
* Sigstore Rekor Transparency Log Anchoring
|
|
1625
1745
|
*
|
|
@@ -2052,6 +2172,29 @@ interface ApprovalResult {
|
|
|
2052
2172
|
contextHash: string;
|
|
2053
2173
|
/** Timestamp of approval */
|
|
2054
2174
|
approvedAt: string;
|
|
2175
|
+
/** On failure, a machine-readable reason (e.g. 'invalid_signature'). */
|
|
2176
|
+
reason?: string;
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* The registered credential public key, extracted from the COSE_Key at
|
|
2180
|
+
* registration. ES256 keys are an uncompressed P-256 point; EdDSA keys are a
|
|
2181
|
+
* 32-byte Ed25519 public key.
|
|
2182
|
+
*/
|
|
2183
|
+
interface CredentialPublicKey {
|
|
2184
|
+
/** COSE algorithm: -7 = ES256 (P-256 / ECDSA), -8 = EdDSA (Ed25519). */
|
|
2185
|
+
alg: -7 | -8;
|
|
2186
|
+
/** Public key, hex. ES256: 65-byte uncompressed point (0x04 || x || y). EdDSA: 32-byte key. */
|
|
2187
|
+
publicKeyHex: string;
|
|
2188
|
+
}
|
|
2189
|
+
interface VerifyAssertionOptions {
|
|
2190
|
+
/** Allowed origin(s) the assertion must come from, e.g. 'https://app.scopeblind.com'. Defaults to https://<rpId>. */
|
|
2191
|
+
expectedOrigin?: string | string[];
|
|
2192
|
+
/** Require the UV (user-verified / biometric or PIN) flag. Default true. */
|
|
2193
|
+
requireUserVerification?: boolean;
|
|
2194
|
+
/** The signCount stored from the previous assertion; a non-increasing counter signals a cloned authenticator. */
|
|
2195
|
+
prevSignCount?: number;
|
|
2196
|
+
/** Override 'now' (ms) for testing. */
|
|
2197
|
+
now?: number;
|
|
2055
2198
|
}
|
|
2056
2199
|
/**
|
|
2057
2200
|
* Create a WebAuthn challenge for approving a tool call.
|
|
@@ -2088,17 +2231,22 @@ declare function toCredentialRequestOptions(challenge: ApprovalChallenge, allowC
|
|
|
2088
2231
|
};
|
|
2089
2232
|
};
|
|
2090
2233
|
/**
|
|
2091
|
-
* Verify a WebAuthn assertion
|
|
2092
|
-
*
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
2234
|
+
* Verify a WebAuthn assertion: full, fail-closed verification of a passkey or
|
|
2235
|
+
* security-key co-sign. This proves a SPECIFIC human authorized a SPECIFIC
|
|
2236
|
+
* action with a hardware-held key the host operator cannot exfiltrate. It
|
|
2237
|
+
* checks, in order: challenge freshness; clientDataJSON type, challenge, and
|
|
2238
|
+
* origin; the rpIdHash; the UP (and, by default, UV) flags; the authenticator
|
|
2239
|
+
* signature over authenticatorData || SHA-256(clientDataJSON) using the
|
|
2240
|
+
* registered credential public key (ES256 or EdDSA); and signCount monotonicity
|
|
2241
|
+
* (clone detection) when a previous count is supplied. Any failure returns
|
|
2242
|
+
* valid:false with a reason; nothing is trusted on a partial check.
|
|
2096
2243
|
*
|
|
2097
|
-
* @param challenge -
|
|
2098
|
-
* @param assertion -
|
|
2099
|
-
* @
|
|
2244
|
+
* @param challenge - the original challenge
|
|
2245
|
+
* @param assertion - the assertion from navigator.credentials.get()
|
|
2246
|
+
* @param credentialPublicKey - the registered public key for assertion.credentialId
|
|
2247
|
+
* @param opts - origin / UV / signCount / clock options
|
|
2100
2248
|
*/
|
|
2101
|
-
declare function verifyApprovalAssertion(challenge: ApprovalChallenge, assertion: ApprovalAssertion): ApprovalResult;
|
|
2249
|
+
declare function verifyApprovalAssertion(challenge: ApprovalChallenge, assertion: ApprovalAssertion, credentialPublicKey?: CredentialPublicKey, opts?: VerifyAssertionOptions): ApprovalResult;
|
|
2102
2250
|
/**
|
|
2103
2251
|
* Create the approval receipt payload for embedding in an Acta receipt.
|
|
2104
2252
|
*
|
|
@@ -3015,4 +3163,4 @@ declare function getScopeBlindBridge(): ScopeBlindBridge;
|
|
|
3015
3163
|
/** Convenience: forward a signed receipt without instantiating yourself. */
|
|
3016
3164
|
declare function forwardReceipt(signedReceipt: any): void;
|
|
3017
3165
|
|
|
3018
|
-
export { type ActionReceipt, type AdmissionResult, type AgentId, type AgentManifest, type ApprovalAssertion, type ApprovalChallenge, type ApprovalNotification, type ApprovalResult, type ArenaPayload, type ArenaReceipt, type AttestationDocument, type AttestationPayload, type AttestationProvider, type AttestationReceipt, type AttestationResult, type AuditBundle, type AuditBundleOptions, type BenchmarkPayload, type BenchmarkReceipt, type BuilderId, type C2PAAssertion, type C2PAIngredient, type C2PAManifest, type C2PAOptions, type CCRConnectorConfig, type CCRSessionContext, type CalibrationScore, type CedarEvalOptions, type CedarEvalRequest, type CedarPolicySet, type CedarSchema, type CedarSchemaResult, type CommittedFieldOpening, type CommittedSignResult, type ComplianceReport, ConfidentialGate, type ConfidentialGateConfig, type ConfidentialInferenceConfig, type CredentialConfig, type DecisionContext, type DecisionLog, type DelegationReceipt, type DisclosureMode, type Ed25519PublicKey, type EvidenceAttestation, type EvidenceAttestationInput, type EvidenceIssuer, type EvidenceReceipt, type EvidenceReceiptBase, type EvidenceSummary, type EvidenceSummaryEntry, type EvidenceType, type ExternalDecision, type ExternalPDPConfig, type HFDatasetMetadata, type HFReceiptRow, type HookEventName, type HookInput, type HookResponse, type IssuerType, type JsonRpcRequest, type JsonRpcResponse, type LeaseCompatibility, type ManifestBuilder, type ManifestCapabilities, type ManifestConfig, type ManifestIdentity, type ManifestPresentation, type ManifestSignature, type ManifestStatus, type McpToolDescription, type MinimalDisclosure, type NotificationConfig, type PassportTokenClaims, type PayloadDigest, type PlanReceipt, type PolicyEngineMode, type PredictionReceipt, type PredictionResolution, type PropagatorConfig, type ProtectConfig, ProtectGateway, type ProtectPolicy, type RateLimit, ReceiptPropagator, type RedactedResult, type RedactionSalt, type RekorAnchor, type RekorVerification, type RestraintPayload, type RestraintReceipt, type SHA256Hash, type SafetyTranscript, type Sandbox, type SandboxConfig, type SandboxReceipt, type SandboxResult, type SandboxToolCall, type SchemaGeneratorConfig, ScopeBlindBridge, type SelfTestCase, type SelfTestReport, type SigningConfig, type SimulationResult, type SimulationSummary, type SwarmContext, type TierOverrides, type TimingMetrics, type ToolPolicy, type TrustTier, type WorkPayload, type WorkReceipt, anchorToRekor, buildDecisionContext, checkRateLimit, collectSignedReceipts, computeCalibration, confidentialInference, createApprovalChallenge, createApprovalReceiptPayload, createAttestationField, createAuditBundle, createC2PAManifest, createDisclosurePackage, createEvidenceAttestation, createLogAnchorField, createReceiptChannel, createSandbox, destroySandbox, discloseField, ed25519ToDIDKey, evaluateCedar, evaluateTier, exportC2PAManifestJSON, exportJSONL, formatReportMarkdown, formatSimulation, forwardReceipt, generateC2PACommand, generateCedarSchema, generateDatasetCard, generateHFMetadata, generateReport, generateSafetyTranscript, generateSchemaStub, getScopeBlindBridge, getSignerInfo, getToolPolicy, hashReceipt, hashResponseBody, initSigning, isAgentId, isCedarAvailable, isDisclosureMode, isEvidenceType, isManifestStatus, isSigningEnabled, listCredentialLabels, loadCedarPolicies, loadPolicy, manifestToVC, meetsMinTier, parseLogFile, parseNotificationConfigFromEnv, parseRateLimit, policySetFromSource, queryExternalPDP, receiptToVP, receiptsToHFRows, redactFields, resolveCredential, revealField, runEvaluatorSelfTest, runInSandbox, sendApprovalNotification, signCommittedDecision, signDecision, simulate, toCredentialRequestOptions, toManifoldFormat, toMetaculusFormat, validateCredentials, validateEvidenceReceipt, validateManifest, verifyActaC2PAAssertions, verifyAllCommitments, verifyApprovalAssertion, verifyCommitment, verifyEvidenceAttestation, verifyRekorAnchor };
|
|
3166
|
+
export { type ActionReceipt, type AdmissionResult, type AgentId, type AgentManifest, type ApprovalAssertion, type ApprovalChallenge, type ApprovalNotification, type ApprovalResult, type ArenaPayload, type ArenaReceipt, type AttestationDocument, type AttestationPayload, type AttestationProvider, type AttestationReceipt, type AttestationResult, type AuditBundle, type AuditBundleOptions, type BenchmarkPayload, type BenchmarkReceipt, type BuilderId, type C2PAAssertion, type C2PAIngredient, type C2PAManifest, type C2PAOptions, type CCRConnectorConfig, type CCRSessionContext, CONNECTOR_PILOTS, type CalibrationScore, type CedarEvalOptions, type CedarEvalRequest, type CedarPolicySet, type CedarSchema, type CedarSchemaResult, type CommittedFieldOpening, type CommittedSignResult, type ComplianceReport, ConfidentialGate, type ConfidentialGateConfig, type ConfidentialInferenceConfig, type ConnectorAction, type ConnectorEnvVar, type ConnectorPilot, type ConnectorPilotId, type CredentialConfig, type DecisionContext, type DecisionLog, type DelegationReceipt, type DisclosureMode, type Ed25519PublicKey, type EvidenceAttestation, type EvidenceAttestationInput, type EvidenceIssuer, type EvidenceReceipt, type EvidenceReceiptBase, type EvidenceSummary, type EvidenceSummaryEntry, type EvidenceType, type ExternalDecision, type ExternalPDPConfig, type HFDatasetMetadata, type HFReceiptRow, type HookEventName, type HookInput, type HookResponse, type InstalledConnectorPilot, type IssuerType, type JsonRpcRequest, type JsonRpcResponse, type LeaseCompatibility, type ManifestBuilder, type ManifestCapabilities, type ManifestConfig, type ManifestIdentity, type ManifestPresentation, type ManifestSignature, type ManifestStatus, type McpToolDescription, type MinimalDisclosure, type NotificationConfig, POLICY_PACKS, type PassportTokenClaims, type PayloadDigest, type PlanReceipt, type PolicyEngineMode, type PolicyPack, type PredictionReceipt, type PredictionResolution, type PropagatorConfig, type ProtectConfig, ProtectGateway, type ProtectPolicy, type RateLimit, ReceiptPropagator, type RedactedResult, type RedactionSalt, type RekorAnchor, type RekorVerification, type RestraintPayload, type RestraintReceipt, type SHA256Hash, type SafetyTranscript, type Sandbox, type SandboxConfig, type SandboxReceipt, type SandboxResult, type SandboxToolCall, type SchemaGeneratorConfig, ScopeBlindBridge, type SelectiveDisclosurePackageV0, type SelectiveDisclosureVerification, type SelfTestCase, type SelfTestReport, type SigningConfig, type SimulationResult, type SimulationSummary, type SwarmContext, type TierOverrides, type TimingMetrics, type ToolPolicy, type TrustTier, type WorkPayload, type WorkReceipt, anchorToRekor, buildDecisionContext, checkRateLimit, collectSignedReceipts, computeCalibration, confidentialInference, connectorDirectory, connectorDoctor, connectorPilotIds, createApprovalChallenge, createApprovalReceiptPayload, createAttestationField, createAuditBundle, createC2PAManifest, createDisclosurePackage, createEvidenceAttestation, createLogAnchorField, createReceiptChannel, createSandbox, createSelectiveDisclosurePackage, destroySandbox, discloseField, ed25519ToDIDKey, evaluateCedar, evaluateTier, exportC2PAManifestJSON, exportJSONL, formatReportMarkdown, formatSimulation, forwardReceipt, generateC2PACommand, generateCedarSchema, generateDatasetCard, generateHFMetadata, generateReport, generateSafetyTranscript, generateSchemaStub, getConnectorPilot, getPolicyPack, getScopeBlindBridge, getSignerInfo, getToolPolicy, hashReceipt, hashResponseBody, initSigning, isAgentId, isCedarAvailable, isDisclosureMode, isEvidenceType, isManifestStatus, isSigningEnabled, listCredentialLabels, loadCedarPolicies, loadPolicy, manifestToVC, meetsMinTier, parseLogFile, parseNotificationConfigFromEnv, parseRateLimit, policyPackIds, policySetFromSource, queryExternalPDP, readInstalledConnectorPilots, receiptToVP, receiptsToHFRows, redactFields, resolveCredential, revealField, runEvaluatorSelfTest, runInSandbox, sendApprovalNotification, signCommittedDecision, signDecision, simulate, toCredentialRequestOptions, toManifoldFormat, toMetaculusFormat, validateCredentials, validateEvidenceReceipt, validateManifest, verifyActaC2PAAssertions, verifyAllCommitments, verifyApprovalAssertion, verifyCommitment, verifyEvidenceAttestation, verifyRekorAnchor, verifySelectiveDisclosurePackage, writeConnectorPilots };
|