Skip to content

assertValidBucketKey

function assertValidBucketKey(key): string;

Defined in: core/src/bucket/bucket.keys.ts:13

Validates an object key. Keys are /-separated, relative, and free of traversal segments: a backend that maps keys onto paths (the filesystem one does) must never be able to write outside its own bucket, and keys arriving from a tool call are attacker-shaped input. Throws InvalidBucketKeyError rather than sanitising, so a bad key is a loud failure instead of a silent write to the wrong place.

Parameter Type
key string

string