Skip to main content

Overview

ValiqorSecurityClient evaluates AI conversations for safety violations (security audits) and generates adversarial attacks to probe vulnerabilities (red teaming). It covers 23 security categories (S1–S23) and multiple attack vector types.
Or standalone:
Supports context manager protocol: with ValiqorSecurityClient(...) as sc:

Constructor


Security Audits

audit()

Evaluate conversations for safety violations. Auto-polls if backend returns async.
Returns: SecurityAuditResult

audit_trace()

Audit a trace dict for security violations. Extracts user/assistant pairs automatically.

audit_async()

Start an asynchronous security audit.
Returns: SecurityJobHandle

Red Teaming

Target modes

Red teaming requires a target — the AI system you want to attack. There are three ways to specify one:
At least one of target_url, target_prompt, or target_function is required.

red_team()

Generate adversarial attacks to probe your AI for vulnerabilities. Always runs asynchronously on the backend (returns 202); the SDK auto-polls until complete.
Returns: RedTeamResult

Attack a live endpoint

Custom request format

If your endpoint expects a non-standard JSON body, use target_request_template with the {{attack}} placeholder and target_response_key to extract the response:

Attack a system prompt

Attack a local function (SDK-only)

target_function sends generate_only=True to the backend, fetches the generated attack prompts, calls your function locally for each one, then submits the responses back for evaluation.

red_team_async()

Start an asynchronous red team simulation. Returns a job handle for manual polling.
Accepts the same target parameters as red_team() except target_function (not supported in async mode). Returns: SecurityJobHandle

Discovery

list_vulnerabilities()

List all supported security vulnerability categories (S1–S23).

list_attack_vectors()

List all available attack vector types.

Result Browsing — Audits

get_audit_result()

Get a completed audit result by batch ID.

list_audit_batches()

List audit history for a project.

get_batch_detail()

get_batch_items()

Get paginated items from an audit batch.

get_audit_item_detail()


Result Browsing — Red Team

get_redteam_result()

list_redteam_runs()

get_redteam_run()

get_redteam_attacks()

Get paginated attacks from a red team run.

get_redteam_attack_detail()

compare_redteam_runs()

Compare 2–5 red team runs side by side.

Project Configuration

get_project_vulnerabilities()

Get vulnerability settings for a project.

get_project_attack_vectors()

update_project_vulnerability()

Update vulnerability thresholds and enablement for a project.

update_project_attack_vector()


Job Management

get_job_status()

cancel_job()


Backward Compatibility


Security Categories (S1–S23)