@sema-agent/core
Version:
Stateless, task-oriented AI agent core
26 lines (25 loc) • 4.13 kB
TypeScript
/**
* The rule names an auto-mode classifier files a blocked call under — a CLOSED set of words, the same set the reference client keeps
* (`xKn` (cli321.js:276085): its built-in rule list plus the six cowork rules). The classifier's reply names the rule it matched in a
* `<category>` tag; the reference reads it as a word of this set or not at all, and so does the engine: a category the set does not
* know is not carried on the gate record, whatever the classifier wrote (the model-facing deny sentence still quotes what the
* classifier wrote, folded — see `foldedBlockOf`).
*
* The words are the rule names spelled the way {@link classifierCategoryOf} normalizes them: lower case, runs of anything that is not
* a letter or a digit as one `_`, no leading or trailing `_` (`Data Exfiltration` → `data_exfiltration`). A deployment that writes
* its own rule names (`rules.hardDeny`) names rules this set does not hold; their blocks carry no category.
*
* Import-free: the verdict reader, the gate record's type and its screen all read it from here.
*/
export declare const CLASSIFIER_CATEGORIES: readonly ["account_standing_rule_changes", "auto_mode_bypass", "blind_apply", "browser_file_upload_exfil", "browser_input_exfil", "browser_js_exfil", "browser_navigate_exfil", "browser_shortcut_execution", "chatops_trigger_comments", "ci_bypass", "cloud_storage_mass_delete", "cluster_wide_workload_creation", "code_from_external", "code_that_leaks_when_run", "command_network_lists", "containment_escape", "cowork_delete_grant", "cowork_folder_access", "cowork_run_routine_now", "cowork_scheduled_task_delete", "cowork_scheduled_task_write", "cowork_skill_persistence", "create_public_surface", "create_rce_surface", "create_unsafe_agents", "credential_exploration", "credential_leakage", "credential_materialization", "data_exfiltration", "dns_domain_cert_changes", "excess_sensitive_detail", "exfil_scouting", "expose_local_services", "external_ingress_tunnel", "external_system_writes", "feature_flag_writes", "git_destructive", "instruction_poisoning", "interfere_with_workloads", "irreversible_deletion_general", "irreversible_local_destruction", "live_shared_artifact_sensitive_delta", "logging_audit_tampering", "merge_without_review", "modify_shared_resources", "node_lifecycle_operations", "out_of_place_publication", "package_registry_bypass", "permission_grant", "pii_data_handling", "production_deploy", "production_reads", "protected_scope_iac_apply", "public_data_sharing_upload", "real_world_transactions", "remote_repoint", "remote_shell_writes", "safety_bypass_flag", "sandbox_network_callback", "secret_store_writes", "security_test_removal", "security_weaken", "self_approval", "self_modification", "sensitive_remote_exec", "sensitive_source_provenance", "session_transcript_tampering", "shared_cluster_mutation", "shared_scratch_sweep", "third_party_attack", "tls_auth_weaken", "tmux_self_drive", "traffic_redirection", "unauthorized_persistence", "unrequested_artifact_publish", "unrequested_commit_in_a_connected_app", "untrusted_code_integration", "unverifiable_deletion_scope", "unverifiable_deletion_target"];
export type ClassifierCategory = (typeof CLASSIFIER_CATEGORIES)[number];
/** Membership test for {@link ClassifierCategory}. */
export declare function isClassifierCategory(v: unknown): v is ClassifierCategory;
/**
* The category a classifier's reply names, read the reference's way over the reply's text with its thinking already removed: EXACTLY ONE
* `<category>` tag whose content is of the accepted spelling ({@link CATEGORY_TAG}; a tag with another spelling — a `/`, a `.`, a
* word past 64 characters — is not counted), normalized to a word (lower case, every run of non-alphanumerics one `_`, trimmed of `_`),
* and that word must be a member of {@link CLASSIFIER_CATEGORIES}. Zero tags, two or more, a spelling outside the accepted one, or a
* word outside the set — each answers `undefined`: the classifier named no category the engine can carry.
*/
export declare function classifierCategoryOf(strippedReply: string): ClassifierCategory | undefined;