@declaw/sdk 1.2.3 → 1.3.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.
package/dist/index.d.cts CHANGED
@@ -186,9 +186,15 @@ interface InjectionDefenseConfig {
186
186
  enabled: boolean;
187
187
  sensitivity: string;
188
188
  action: string;
189
- /** Detection threshold (0.0–1.0). Defaults to 0.8. */
189
+ /** Detection threshold (0.0–1.0). Defaults to 0.95. */
190
190
  threshold: number;
191
- /** Optional domain allowlist; when undefined, applies to all domains. */
191
+ /**
192
+ * Scopes injection scanning to these destination hosts. Injection is
193
+ * OPT-IN per domain: with an empty or omitted list NO injection scanning
194
+ * runs (unlike PII/toxicity, where an empty list means all egress).
195
+ * Entries support exact hosts (`"api.example.com"`), `"*.suffix.com"`
196
+ * wildcards, and `"~regex"` patterns.
197
+ */
192
198
  domains?: string[];
193
199
  /** Optional Tier-2 LLM judge. */
194
200
  judge?: InjectionJudgeConfig;
@@ -451,9 +457,13 @@ interface FullInjectionDefenseOptions {
451
457
  action?: string;
452
458
  /** Run the judge on EVERY egress (high-assurance, costlier). Default false. */
453
459
  alwaysJudge?: boolean;
454
- /** Optional egress allowlist to scan; omit = all domains. */
460
+ /**
461
+ * Destination hosts to scan for injection. Injection is opt-in per domain:
462
+ * omit or leave empty to scan none. Entries support exact hosts,
463
+ * `"*.suffix.com"` wildcards, and `"~regex"` patterns.
464
+ */
455
465
  domains?: string[];
456
- /** Tier-1 classifier confidence threshold (0.0–1.0). Default 0.8. */
466
+ /** Tier-1 classifier confidence threshold (0.0–1.0). Default 0.95. */
457
467
  threshold?: number;
458
468
  }
459
469
  /**
@@ -1191,6 +1201,10 @@ interface SandboxOpts {
1191
1201
  metadata?: Record<string, string>;
1192
1202
  /** Environment variables. */
1193
1203
  envs?: Record<string, string>;
1204
+ /** Vault secret references: ENV_NAME -> "vault://team/env/secret". The real
1205
+ * value is resolved server+worker-side and injected at the egress proxy —
1206
+ * the sandbox only ever sees a placeholder, never the secret value. */
1207
+ vaultRefs?: Record<string, string>;
1194
1208
  /** Whether to create a secure sandbox. Defaults to true. */
1195
1209
  secure?: boolean;
1196
1210
  /** If false, denies all outbound traffic. Defaults to true. */
@@ -1870,8 +1884,17 @@ interface VolumeCreateOpts extends VolumeRequestOpts {
1870
1884
  * are dropped on the server for safety.
1871
1885
  */
1872
1886
  declare class Volumes {
1873
- /** Create a volume by streaming a tarball (gzip tar.gz) to the server. */
1874
- static create(name: string, data: Uint8Array | ArrayBuffer, opts?: VolumeCreateOpts): Promise<VolumeInfo>;
1887
+ /**
1888
+ * Create a volume named `name`, optionally populated with `data`.
1889
+ *
1890
+ * `POST /volumes` is the canonical create endpoint. With `data` (a gzip tar.gz)
1891
+ * the body is ingested into a new file-granular volume (or a legacy tarball
1892
+ * blob if no file-granular backend is configured). Creating an empty volume
1893
+ * (no `data`, or an empty buffer) requires a file-granular backend.
1894
+ * `empty(name)` / `ingest(name, data)` remain available for explicit,
1895
+ * backend-specific control.
1896
+ */
1897
+ static create(name: string, data?: Uint8Array | ArrayBuffer, opts?: VolumeCreateOpts): Promise<VolumeInfo>;
1875
1898
  /**
1876
1899
  * Capture the attached volume's mount path in `sandboxId` into a NEW volume.
1877
1900
  *
@@ -1995,4 +2018,136 @@ declare class Governance {
1995
2018
  static getPack(name: string, opts?: GovernanceRequestOpts): Promise<GovernancePack>;
1996
2019
  }
1997
2020
 
1998
- export { ALL_TRAFFIC, ApiClient, type AuditConfig, type AuditEntry, AuthenticationError, BuildError, type BuildInfo, type CodeSecurityConfig, CommandExitError, CommandHandle, type CommandResult, type CommandWaitOpts, Commands, ConflictError, ConnectionConfig, type ConnectionConfigOptions, type ContentGateConfig, type CopyItem, DEFAULT_MASK_PATTERNS, type EntryInfo, type EnvSecurityConfig, type FileEntry, type FileInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type FullInjectionDefenseOptions, type GetBuildStatusOpts, GitAuthError, GitUpstreamError, Governance, type GovernanceAdvisory, type GovernanceControl, type GovernancePack, type GovernanceRequestOpts, InjectionAction, type InjectionDefenseConfig, type InjectionJudgeConfig, InjectionSensitivity, InvalidArgumentError, type InvisibleTextConfig, type LockLease, type LockStatus, type NetworkPolicy, NotEnoughSpaceError, NotFoundError, type PIIConfig, PIIType, type ProcessInfo, Pty, type PtyConnectOpts, type PtyCreateOpts, PtyHandle, type PtyOutput, type PtyResult, type PtySize, RedactionAction, type RequestOpts, type RunOpts, type RunStreamOpts, Sandbox, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxMetrics, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxQuery, SandboxState, type SecureEnvVar, type SecurityPolicy, type Snapshot, type SnapshotInfo, SnapshotPaginator, type SnapshotSource, type Stderr, Stdio, StdioProcess, type StdioResult, type StdioStartOpts, type Stdout, Template, TemplateBase, type TemplateBuildOpts, type TemplateBuildStatus, TemplateError, TimeoutError, type ToxicityConfig, TransformDirection, type TransformationRule, type VolumeAttachMode, type VolumeAttachment, type VolumeCreateOpts, VolumeFiles, type VolumeInfo, VolumeLocks, type VolumeRemoveOpts, type VolumeRequestOpts, type VolumeWriteOpts, Volumes, WatchHandle, type WriteEntry, type WriteInfo, applyTransformation, codeSecurityConfigToJSON, contentGateConfigToJSON, createAuditConfig, createCodeSecurityConfig, createContentGateConfig, createEnvSecurityConfig, createInjectionDefenseConfig, createInvisibleTextConfig, createNetworkPolicy, createPIIConfig, createSecurityPolicy, createToxicityConfig, createTransformationRule, domainMatches, fullInjectionDefensePolicy, getSharedClient, invisibleTextConfigToJSON, isSensitive, networkPolicyToOpts, parseAuditConfig, parseAuditEntry, parseBuildInfo, parseCodeSecurityConfig, parseCommandResult, parseContentGateConfig, parseEntryInfo, parseEnvSecurityConfig, parseFileEntry, parseFileInfo, parseFilesystemEvent, parseGovernancePack, parseInjectionDefenseConfig, parseInvisibleTextConfig, parseLockLease, parseLockStatus, parseNetworkPolicy, parsePIIConfig, parseProcessInfo, parseSandboxInfo, parseSandboxLifecycle, parseSandboxMetrics, parseSecurityPolicy, parseSnapshot, parseSnapshotInfo, parseTemplateBuildStatus, parseToxicityConfig, parseVolumeInfo, parseWriteInfo, requiresTlsInterception, resetSharedClients, securityPolicyToJSON, toxicityConfigToJSON, validateNetworkEntry, volumeAttachmentToJSON };
2021
+ /**
2022
+ * One per-destination injection rule on a secret. The egress proxy matches
2023
+ * a request host against domainRegex and injects the secret as injectionType
2024
+ * (bearer|header|basic|query|sigv4|oidc|hmac|redis|postgres|mysql|smtp|mongodb).
2025
+ * The optional fields express a provider's full contract.
2026
+ */
2027
+ interface VaultScope {
2028
+ domainRegex: string;
2029
+ injectionType?: string;
2030
+ headerName?: string;
2031
+ valuePrefix?: string;
2032
+ basicUsername?: string;
2033
+ extraHeaders?: Record<string, string>;
2034
+ queryParams?: Record<string, string>;
2035
+ }
2036
+ /**
2037
+ * Metadata for a stored secret — never the value. The value lives
2038
+ * server-side (OpenBao) and is not returned after create.
2039
+ */
2040
+ interface VaultSecret {
2041
+ secretId: string;
2042
+ name: string;
2043
+ scopes?: VaultScope[];
2044
+ createdAt: string;
2045
+ updatedAt: string;
2046
+ rotatedAt?: string;
2047
+ rotationIntervalDays?: number;
2048
+ rotationDue?: boolean;
2049
+ }
2050
+ /**
2051
+ * A built-in provider template (domain + injection rules). Used so a caller
2052
+ * can store a credential by naming the provider and supplying only the value.
2053
+ * Carries no secret material.
2054
+ */
2055
+ interface VaultPreset {
2056
+ key: string;
2057
+ name: string;
2058
+ category: string;
2059
+ keyHint: string;
2060
+ docsUrl?: string;
2061
+ scopes: VaultScope[];
2062
+ }
2063
+ /** Parse a raw wire-format scope into a VaultScope. */
2064
+ declare function parseVaultScope(data: Record<string, unknown>): VaultScope;
2065
+ /** Parse a raw wire-format secret row into a VaultSecret. */
2066
+ declare function parseVaultSecret(data: Record<string, unknown>): VaultSecret;
2067
+ /** Parse a raw wire-format preset into a VaultPreset. */
2068
+ declare function parseVaultPreset(data: Record<string, unknown>): VaultPreset;
2069
+ /** Render a VaultScope in wire (snake_case) form for request bodies. */
2070
+ declare function vaultScopeToJSON(scope: VaultScope): Record<string, unknown>;
2071
+
2072
+ /** Shared per-call options for Vault methods. */
2073
+ interface VaultRequestOpts {
2074
+ /** API key override. */
2075
+ apiKey?: string;
2076
+ /** Domain override. */
2077
+ domain?: string;
2078
+ /** Full API URL override. */
2079
+ apiUrl?: string;
2080
+ /** Per-request timeout in milliseconds. */
2081
+ requestTimeout?: number;
2082
+ }
2083
+ /**
2084
+ * Input for creating a vault secret. The team and environment are resolved
2085
+ * automatically (a single "default" team + "prod" environment per account) —
2086
+ * those concepts are not part of the public API.
2087
+ */
2088
+ interface CreateSecretInput {
2089
+ /** The secret value (required; never returned after create). */
2090
+ value: string;
2091
+ /** Secret name. Defaults to provider when omitted. */
2092
+ name?: string;
2093
+ /** Optional preset provider key, e.g. "openai". Supplies scopes automatically. */
2094
+ provider?: string;
2095
+ /** Explicit injection scopes. Required unless provider is set. */
2096
+ scopes?: VaultScope[];
2097
+ /** Rotation policy in days. Omitted when 0 or not set. */
2098
+ rotationIntervalDays?: number;
2099
+ }
2100
+ /**
2101
+ * Vault secret management. All methods are static and derive their connection
2102
+ * from the trailing VaultRequestOpts argument (or env vars when opts is
2103
+ * omitted). The team/environment concepts are handled automatically — every
2104
+ * secret lives under a single auto-provisioned "default" team and "prod"
2105
+ * environment. Secrets are addressed by name only.
2106
+ */
2107
+ declare class Vault {
2108
+ /**
2109
+ * Store a secret's value (server-side, in OpenBao) plus its injection
2110
+ * scopes, under the auto-provisioned default team + "prod" environment.
2111
+ * Returns metadata only — the value is never echoed.
2112
+ *
2113
+ * POST /teams/{teamId}/vault/secrets
2114
+ */
2115
+ static createSecret(input: CreateSecretInput, opts?: VaultRequestOpts): Promise<VaultSecret>;
2116
+ /**
2117
+ * List secret metadata for the default team. Returns an empty array if no
2118
+ * default team has been provisioned yet.
2119
+ *
2120
+ * GET /teams/{teamId}/vault/secrets -> {secrets}
2121
+ */
2122
+ static listSecrets(opts?: VaultRequestOpts): Promise<VaultSecret[]>;
2123
+ /**
2124
+ * Replace a secret's value by name (server-side); scopes are unchanged.
2125
+ *
2126
+ * POST /teams/{teamId}/vault/secrets/{secretId}/rotate {value}
2127
+ */
2128
+ static rotateSecret(name: string, value: string, opts?: VaultRequestOpts): Promise<void>;
2129
+ /**
2130
+ * Delete a secret by name — metadata and stored value.
2131
+ *
2132
+ * DELETE /teams/{teamId}/vault/secrets/{secretId}
2133
+ */
2134
+ static deleteSecret(name: string, opts?: VaultRequestOpts): Promise<void>;
2135
+ /**
2136
+ * Replace a secret's injection scopes by name; the value is unchanged. Use
2137
+ * this to change a secret's destination(s) or injection format in place
2138
+ * instead of delete + recreate. At least one scope is required.
2139
+ *
2140
+ * POST /teams/{teamId}/vault/secrets/{secretId}/scopes
2141
+ */
2142
+ static updateScopes(name: string, scopes: VaultScope[], opts?: VaultRequestOpts): Promise<void>;
2143
+ /**
2144
+ * List built-in provider preset catalog (templates only, no secret material).
2145
+ *
2146
+ * GET /vault/presets -> {presets}
2147
+ */
2148
+ static listPresets(opts?: VaultRequestOpts): Promise<VaultPreset[]>;
2149
+ /** Maps a secret name to its id within the given team. */
2150
+ private static _resolveSecretId;
2151
+ }
2152
+
2153
+ export { ALL_TRAFFIC, ApiClient, type AuditConfig, type AuditEntry, AuthenticationError, BuildError, type BuildInfo, type CodeSecurityConfig, CommandExitError, CommandHandle, type CommandResult, type CommandWaitOpts, Commands, ConflictError, ConnectionConfig, type ConnectionConfigOptions, type ContentGateConfig, type CopyItem, type CreateSecretInput, DEFAULT_MASK_PATTERNS, type EntryInfo, type EnvSecurityConfig, type FileEntry, type FileInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type FullInjectionDefenseOptions, type GetBuildStatusOpts, GitAuthError, GitUpstreamError, Governance, type GovernanceAdvisory, type GovernanceControl, type GovernancePack, type GovernanceRequestOpts, InjectionAction, type InjectionDefenseConfig, type InjectionJudgeConfig, InjectionSensitivity, InvalidArgumentError, type InvisibleTextConfig, type LockLease, type LockStatus, type NetworkPolicy, NotEnoughSpaceError, NotFoundError, type PIIConfig, PIIType, type ProcessInfo, Pty, type PtyConnectOpts, type PtyCreateOpts, PtyHandle, type PtyOutput, type PtyResult, type PtySize, RedactionAction, type RequestOpts, type RunOpts, type RunStreamOpts, Sandbox, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxMetrics, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxQuery, SandboxState, type SecureEnvVar, type SecurityPolicy, type Snapshot, type SnapshotInfo, SnapshotPaginator, type SnapshotSource, type Stderr, Stdio, StdioProcess, type StdioResult, type StdioStartOpts, type Stdout, Template, TemplateBase, type TemplateBuildOpts, type TemplateBuildStatus, TemplateError, TimeoutError, type ToxicityConfig, TransformDirection, type TransformationRule, Vault, type VaultPreset, type VaultRequestOpts, type VaultScope, type VaultSecret, type VolumeAttachMode, type VolumeAttachment, type VolumeCreateOpts, VolumeFiles, type VolumeInfo, VolumeLocks, type VolumeRemoveOpts, type VolumeRequestOpts, type VolumeWriteOpts, Volumes, WatchHandle, type WriteEntry, type WriteInfo, applyTransformation, codeSecurityConfigToJSON, contentGateConfigToJSON, createAuditConfig, createCodeSecurityConfig, createContentGateConfig, createEnvSecurityConfig, createInjectionDefenseConfig, createInvisibleTextConfig, createNetworkPolicy, createPIIConfig, createSecurityPolicy, createToxicityConfig, createTransformationRule, domainMatches, fullInjectionDefensePolicy, getSharedClient, invisibleTextConfigToJSON, isSensitive, networkPolicyToOpts, parseAuditConfig, parseAuditEntry, parseBuildInfo, parseCodeSecurityConfig, parseCommandResult, parseContentGateConfig, parseEntryInfo, parseEnvSecurityConfig, parseFileEntry, parseFileInfo, parseFilesystemEvent, parseGovernancePack, parseInjectionDefenseConfig, parseInvisibleTextConfig, parseLockLease, parseLockStatus, parseNetworkPolicy, parsePIIConfig, parseProcessInfo, parseSandboxInfo, parseSandboxLifecycle, parseSandboxMetrics, parseSecurityPolicy, parseSnapshot, parseSnapshotInfo, parseTemplateBuildStatus, parseToxicityConfig, parseVaultPreset, parseVaultScope, parseVaultSecret, parseVolumeInfo, parseWriteInfo, requiresTlsInterception, resetSharedClients, securityPolicyToJSON, toxicityConfigToJSON, validateNetworkEntry, vaultScopeToJSON, volumeAttachmentToJSON };
package/dist/index.d.ts CHANGED
@@ -186,9 +186,15 @@ interface InjectionDefenseConfig {
186
186
  enabled: boolean;
187
187
  sensitivity: string;
188
188
  action: string;
189
- /** Detection threshold (0.0–1.0). Defaults to 0.8. */
189
+ /** Detection threshold (0.0–1.0). Defaults to 0.95. */
190
190
  threshold: number;
191
- /** Optional domain allowlist; when undefined, applies to all domains. */
191
+ /**
192
+ * Scopes injection scanning to these destination hosts. Injection is
193
+ * OPT-IN per domain: with an empty or omitted list NO injection scanning
194
+ * runs (unlike PII/toxicity, where an empty list means all egress).
195
+ * Entries support exact hosts (`"api.example.com"`), `"*.suffix.com"`
196
+ * wildcards, and `"~regex"` patterns.
197
+ */
192
198
  domains?: string[];
193
199
  /** Optional Tier-2 LLM judge. */
194
200
  judge?: InjectionJudgeConfig;
@@ -451,9 +457,13 @@ interface FullInjectionDefenseOptions {
451
457
  action?: string;
452
458
  /** Run the judge on EVERY egress (high-assurance, costlier). Default false. */
453
459
  alwaysJudge?: boolean;
454
- /** Optional egress allowlist to scan; omit = all domains. */
460
+ /**
461
+ * Destination hosts to scan for injection. Injection is opt-in per domain:
462
+ * omit or leave empty to scan none. Entries support exact hosts,
463
+ * `"*.suffix.com"` wildcards, and `"~regex"` patterns.
464
+ */
455
465
  domains?: string[];
456
- /** Tier-1 classifier confidence threshold (0.0–1.0). Default 0.8. */
466
+ /** Tier-1 classifier confidence threshold (0.0–1.0). Default 0.95. */
457
467
  threshold?: number;
458
468
  }
459
469
  /**
@@ -1191,6 +1201,10 @@ interface SandboxOpts {
1191
1201
  metadata?: Record<string, string>;
1192
1202
  /** Environment variables. */
1193
1203
  envs?: Record<string, string>;
1204
+ /** Vault secret references: ENV_NAME -> "vault://team/env/secret". The real
1205
+ * value is resolved server+worker-side and injected at the egress proxy —
1206
+ * the sandbox only ever sees a placeholder, never the secret value. */
1207
+ vaultRefs?: Record<string, string>;
1194
1208
  /** Whether to create a secure sandbox. Defaults to true. */
1195
1209
  secure?: boolean;
1196
1210
  /** If false, denies all outbound traffic. Defaults to true. */
@@ -1870,8 +1884,17 @@ interface VolumeCreateOpts extends VolumeRequestOpts {
1870
1884
  * are dropped on the server for safety.
1871
1885
  */
1872
1886
  declare class Volumes {
1873
- /** Create a volume by streaming a tarball (gzip tar.gz) to the server. */
1874
- static create(name: string, data: Uint8Array | ArrayBuffer, opts?: VolumeCreateOpts): Promise<VolumeInfo>;
1887
+ /**
1888
+ * Create a volume named `name`, optionally populated with `data`.
1889
+ *
1890
+ * `POST /volumes` is the canonical create endpoint. With `data` (a gzip tar.gz)
1891
+ * the body is ingested into a new file-granular volume (or a legacy tarball
1892
+ * blob if no file-granular backend is configured). Creating an empty volume
1893
+ * (no `data`, or an empty buffer) requires a file-granular backend.
1894
+ * `empty(name)` / `ingest(name, data)` remain available for explicit,
1895
+ * backend-specific control.
1896
+ */
1897
+ static create(name: string, data?: Uint8Array | ArrayBuffer, opts?: VolumeCreateOpts): Promise<VolumeInfo>;
1875
1898
  /**
1876
1899
  * Capture the attached volume's mount path in `sandboxId` into a NEW volume.
1877
1900
  *
@@ -1995,4 +2018,136 @@ declare class Governance {
1995
2018
  static getPack(name: string, opts?: GovernanceRequestOpts): Promise<GovernancePack>;
1996
2019
  }
1997
2020
 
1998
- export { ALL_TRAFFIC, ApiClient, type AuditConfig, type AuditEntry, AuthenticationError, BuildError, type BuildInfo, type CodeSecurityConfig, CommandExitError, CommandHandle, type CommandResult, type CommandWaitOpts, Commands, ConflictError, ConnectionConfig, type ConnectionConfigOptions, type ContentGateConfig, type CopyItem, DEFAULT_MASK_PATTERNS, type EntryInfo, type EnvSecurityConfig, type FileEntry, type FileInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type FullInjectionDefenseOptions, type GetBuildStatusOpts, GitAuthError, GitUpstreamError, Governance, type GovernanceAdvisory, type GovernanceControl, type GovernancePack, type GovernanceRequestOpts, InjectionAction, type InjectionDefenseConfig, type InjectionJudgeConfig, InjectionSensitivity, InvalidArgumentError, type InvisibleTextConfig, type LockLease, type LockStatus, type NetworkPolicy, NotEnoughSpaceError, NotFoundError, type PIIConfig, PIIType, type ProcessInfo, Pty, type PtyConnectOpts, type PtyCreateOpts, PtyHandle, type PtyOutput, type PtyResult, type PtySize, RedactionAction, type RequestOpts, type RunOpts, type RunStreamOpts, Sandbox, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxMetrics, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxQuery, SandboxState, type SecureEnvVar, type SecurityPolicy, type Snapshot, type SnapshotInfo, SnapshotPaginator, type SnapshotSource, type Stderr, Stdio, StdioProcess, type StdioResult, type StdioStartOpts, type Stdout, Template, TemplateBase, type TemplateBuildOpts, type TemplateBuildStatus, TemplateError, TimeoutError, type ToxicityConfig, TransformDirection, type TransformationRule, type VolumeAttachMode, type VolumeAttachment, type VolumeCreateOpts, VolumeFiles, type VolumeInfo, VolumeLocks, type VolumeRemoveOpts, type VolumeRequestOpts, type VolumeWriteOpts, Volumes, WatchHandle, type WriteEntry, type WriteInfo, applyTransformation, codeSecurityConfigToJSON, contentGateConfigToJSON, createAuditConfig, createCodeSecurityConfig, createContentGateConfig, createEnvSecurityConfig, createInjectionDefenseConfig, createInvisibleTextConfig, createNetworkPolicy, createPIIConfig, createSecurityPolicy, createToxicityConfig, createTransformationRule, domainMatches, fullInjectionDefensePolicy, getSharedClient, invisibleTextConfigToJSON, isSensitive, networkPolicyToOpts, parseAuditConfig, parseAuditEntry, parseBuildInfo, parseCodeSecurityConfig, parseCommandResult, parseContentGateConfig, parseEntryInfo, parseEnvSecurityConfig, parseFileEntry, parseFileInfo, parseFilesystemEvent, parseGovernancePack, parseInjectionDefenseConfig, parseInvisibleTextConfig, parseLockLease, parseLockStatus, parseNetworkPolicy, parsePIIConfig, parseProcessInfo, parseSandboxInfo, parseSandboxLifecycle, parseSandboxMetrics, parseSecurityPolicy, parseSnapshot, parseSnapshotInfo, parseTemplateBuildStatus, parseToxicityConfig, parseVolumeInfo, parseWriteInfo, requiresTlsInterception, resetSharedClients, securityPolicyToJSON, toxicityConfigToJSON, validateNetworkEntry, volumeAttachmentToJSON };
2021
+ /**
2022
+ * One per-destination injection rule on a secret. The egress proxy matches
2023
+ * a request host against domainRegex and injects the secret as injectionType
2024
+ * (bearer|header|basic|query|sigv4|oidc|hmac|redis|postgres|mysql|smtp|mongodb).
2025
+ * The optional fields express a provider's full contract.
2026
+ */
2027
+ interface VaultScope {
2028
+ domainRegex: string;
2029
+ injectionType?: string;
2030
+ headerName?: string;
2031
+ valuePrefix?: string;
2032
+ basicUsername?: string;
2033
+ extraHeaders?: Record<string, string>;
2034
+ queryParams?: Record<string, string>;
2035
+ }
2036
+ /**
2037
+ * Metadata for a stored secret — never the value. The value lives
2038
+ * server-side (OpenBao) and is not returned after create.
2039
+ */
2040
+ interface VaultSecret {
2041
+ secretId: string;
2042
+ name: string;
2043
+ scopes?: VaultScope[];
2044
+ createdAt: string;
2045
+ updatedAt: string;
2046
+ rotatedAt?: string;
2047
+ rotationIntervalDays?: number;
2048
+ rotationDue?: boolean;
2049
+ }
2050
+ /**
2051
+ * A built-in provider template (domain + injection rules). Used so a caller
2052
+ * can store a credential by naming the provider and supplying only the value.
2053
+ * Carries no secret material.
2054
+ */
2055
+ interface VaultPreset {
2056
+ key: string;
2057
+ name: string;
2058
+ category: string;
2059
+ keyHint: string;
2060
+ docsUrl?: string;
2061
+ scopes: VaultScope[];
2062
+ }
2063
+ /** Parse a raw wire-format scope into a VaultScope. */
2064
+ declare function parseVaultScope(data: Record<string, unknown>): VaultScope;
2065
+ /** Parse a raw wire-format secret row into a VaultSecret. */
2066
+ declare function parseVaultSecret(data: Record<string, unknown>): VaultSecret;
2067
+ /** Parse a raw wire-format preset into a VaultPreset. */
2068
+ declare function parseVaultPreset(data: Record<string, unknown>): VaultPreset;
2069
+ /** Render a VaultScope in wire (snake_case) form for request bodies. */
2070
+ declare function vaultScopeToJSON(scope: VaultScope): Record<string, unknown>;
2071
+
2072
+ /** Shared per-call options for Vault methods. */
2073
+ interface VaultRequestOpts {
2074
+ /** API key override. */
2075
+ apiKey?: string;
2076
+ /** Domain override. */
2077
+ domain?: string;
2078
+ /** Full API URL override. */
2079
+ apiUrl?: string;
2080
+ /** Per-request timeout in milliseconds. */
2081
+ requestTimeout?: number;
2082
+ }
2083
+ /**
2084
+ * Input for creating a vault secret. The team and environment are resolved
2085
+ * automatically (a single "default" team + "prod" environment per account) —
2086
+ * those concepts are not part of the public API.
2087
+ */
2088
+ interface CreateSecretInput {
2089
+ /** The secret value (required; never returned after create). */
2090
+ value: string;
2091
+ /** Secret name. Defaults to provider when omitted. */
2092
+ name?: string;
2093
+ /** Optional preset provider key, e.g. "openai". Supplies scopes automatically. */
2094
+ provider?: string;
2095
+ /** Explicit injection scopes. Required unless provider is set. */
2096
+ scopes?: VaultScope[];
2097
+ /** Rotation policy in days. Omitted when 0 or not set. */
2098
+ rotationIntervalDays?: number;
2099
+ }
2100
+ /**
2101
+ * Vault secret management. All methods are static and derive their connection
2102
+ * from the trailing VaultRequestOpts argument (or env vars when opts is
2103
+ * omitted). The team/environment concepts are handled automatically — every
2104
+ * secret lives under a single auto-provisioned "default" team and "prod"
2105
+ * environment. Secrets are addressed by name only.
2106
+ */
2107
+ declare class Vault {
2108
+ /**
2109
+ * Store a secret's value (server-side, in OpenBao) plus its injection
2110
+ * scopes, under the auto-provisioned default team + "prod" environment.
2111
+ * Returns metadata only — the value is never echoed.
2112
+ *
2113
+ * POST /teams/{teamId}/vault/secrets
2114
+ */
2115
+ static createSecret(input: CreateSecretInput, opts?: VaultRequestOpts): Promise<VaultSecret>;
2116
+ /**
2117
+ * List secret metadata for the default team. Returns an empty array if no
2118
+ * default team has been provisioned yet.
2119
+ *
2120
+ * GET /teams/{teamId}/vault/secrets -> {secrets}
2121
+ */
2122
+ static listSecrets(opts?: VaultRequestOpts): Promise<VaultSecret[]>;
2123
+ /**
2124
+ * Replace a secret's value by name (server-side); scopes are unchanged.
2125
+ *
2126
+ * POST /teams/{teamId}/vault/secrets/{secretId}/rotate {value}
2127
+ */
2128
+ static rotateSecret(name: string, value: string, opts?: VaultRequestOpts): Promise<void>;
2129
+ /**
2130
+ * Delete a secret by name — metadata and stored value.
2131
+ *
2132
+ * DELETE /teams/{teamId}/vault/secrets/{secretId}
2133
+ */
2134
+ static deleteSecret(name: string, opts?: VaultRequestOpts): Promise<void>;
2135
+ /**
2136
+ * Replace a secret's injection scopes by name; the value is unchanged. Use
2137
+ * this to change a secret's destination(s) or injection format in place
2138
+ * instead of delete + recreate. At least one scope is required.
2139
+ *
2140
+ * POST /teams/{teamId}/vault/secrets/{secretId}/scopes
2141
+ */
2142
+ static updateScopes(name: string, scopes: VaultScope[], opts?: VaultRequestOpts): Promise<void>;
2143
+ /**
2144
+ * List built-in provider preset catalog (templates only, no secret material).
2145
+ *
2146
+ * GET /vault/presets -> {presets}
2147
+ */
2148
+ static listPresets(opts?: VaultRequestOpts): Promise<VaultPreset[]>;
2149
+ /** Maps a secret name to its id within the given team. */
2150
+ private static _resolveSecretId;
2151
+ }
2152
+
2153
+ export { ALL_TRAFFIC, ApiClient, type AuditConfig, type AuditEntry, AuthenticationError, BuildError, type BuildInfo, type CodeSecurityConfig, CommandExitError, CommandHandle, type CommandResult, type CommandWaitOpts, Commands, ConflictError, ConnectionConfig, type ConnectionConfigOptions, type ContentGateConfig, type CopyItem, type CreateSecretInput, DEFAULT_MASK_PATTERNS, type EntryInfo, type EnvSecurityConfig, type FileEntry, type FileInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type FullInjectionDefenseOptions, type GetBuildStatusOpts, GitAuthError, GitUpstreamError, Governance, type GovernanceAdvisory, type GovernanceControl, type GovernancePack, type GovernanceRequestOpts, InjectionAction, type InjectionDefenseConfig, type InjectionJudgeConfig, InjectionSensitivity, InvalidArgumentError, type InvisibleTextConfig, type LockLease, type LockStatus, type NetworkPolicy, NotEnoughSpaceError, NotFoundError, type PIIConfig, PIIType, type ProcessInfo, Pty, type PtyConnectOpts, type PtyCreateOpts, PtyHandle, type PtyOutput, type PtyResult, type PtySize, RedactionAction, type RequestOpts, type RunOpts, type RunStreamOpts, Sandbox, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxMetrics, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxQuery, SandboxState, type SecureEnvVar, type SecurityPolicy, type Snapshot, type SnapshotInfo, SnapshotPaginator, type SnapshotSource, type Stderr, Stdio, StdioProcess, type StdioResult, type StdioStartOpts, type Stdout, Template, TemplateBase, type TemplateBuildOpts, type TemplateBuildStatus, TemplateError, TimeoutError, type ToxicityConfig, TransformDirection, type TransformationRule, Vault, type VaultPreset, type VaultRequestOpts, type VaultScope, type VaultSecret, type VolumeAttachMode, type VolumeAttachment, type VolumeCreateOpts, VolumeFiles, type VolumeInfo, VolumeLocks, type VolumeRemoveOpts, type VolumeRequestOpts, type VolumeWriteOpts, Volumes, WatchHandle, type WriteEntry, type WriteInfo, applyTransformation, codeSecurityConfigToJSON, contentGateConfigToJSON, createAuditConfig, createCodeSecurityConfig, createContentGateConfig, createEnvSecurityConfig, createInjectionDefenseConfig, createInvisibleTextConfig, createNetworkPolicy, createPIIConfig, createSecurityPolicy, createToxicityConfig, createTransformationRule, domainMatches, fullInjectionDefensePolicy, getSharedClient, invisibleTextConfigToJSON, isSensitive, networkPolicyToOpts, parseAuditConfig, parseAuditEntry, parseBuildInfo, parseCodeSecurityConfig, parseCommandResult, parseContentGateConfig, parseEntryInfo, parseEnvSecurityConfig, parseFileEntry, parseFileInfo, parseFilesystemEvent, parseGovernancePack, parseInjectionDefenseConfig, parseInvisibleTextConfig, parseLockLease, parseLockStatus, parseNetworkPolicy, parsePIIConfig, parseProcessInfo, parseSandboxInfo, parseSandboxLifecycle, parseSandboxMetrics, parseSecurityPolicy, parseSnapshot, parseSnapshotInfo, parseTemplateBuildStatus, parseToxicityConfig, parseVaultPreset, parseVaultScope, parseVaultSecret, parseVolumeInfo, parseWriteInfo, requiresTlsInterception, resetSharedClients, securityPolicyToJSON, toxicityConfigToJSON, validateNetworkEntry, vaultScopeToJSON, volumeAttachmentToJSON };