> ## Documentation Index
> Fetch the complete documentation index at: https://docs.repello.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ArgusClient Class and Method Reference

> This is the definitive reference for all public methods and properties of the ArgusClient.

### **Initialization**

### `ArgusClient.create()`

*Initializes a new client instance. This is the required method for creating a client.*

```python theme={null}
@classmethod
def create(
    cls,
    api_key: str,
    url: Optional[str] = None,
    asset_id: Optional[str] = None,
    session_id: Optional[str] = None,
    policy: Optional[Policy] = None,
    save: bool = False,
    strict: bool = True
) -> "ArgusClient"
```

**Parameters:**

* `api_key` (`str`): **Required.** Your Argus API key. The key prefix (`rsk_` or `sk_`) determines the client tier.
* `url` (`Optional[str]`): An optional URL to connect to a self-hosted or alternative Argus environment.
* `asset_id` (`Optional[str]`): **Platform Tier Only.** The default Asset ID for all scans made with this client.
* `session_id` (`Optional[str]`): **Platform Tier Only.** The default Session ID for all scans.
* `policy` (`Optional[Policy]`): A `Policy` dictionary defining the default security rules.
* `save` (`bool`): **Platform Tier Only.** If `True`, all scan data is persisted in the Argus platform. Defaults to `False`.
* `strict` (`bool`): If `True` (default), client-side configuration errors will raise an exception. If `False`, a warning is issued instead.

**Returns:** An initialized `ArgusClient` instance.

**Example:**

```python theme={null}
# Platform Tier User (rsk_ key)
client = ArgusClient.create(
    api_key="rsk_...",
	url="https://argususapi.repello.ai/sdk/v1"
    asset_id="your-chatbot-asset-id",
    save=True
)

# Free Tier User (sk_ key)
client = ArgusClient.create(
    api_key="sk_...",
    policy={PolicyName.PII_DETECTION: {"action": Action.BLOCK}}
)
```

***

### **General Scan Methods**

These are the primary methods for performing ad-hoc scans on text.

### `check_content()`

*The most flexible method for scanning a string of text. This is the primary method used by the Guardrail system.*

```python theme={null}
def check_content(
    self,
    content: str,
    *,
    policies: Optional[Policy] = None,
    # ... other platform-specific overrides
) -> ApiResult
```

**Parameters:**

* `content` (`str`): The text to be scanned.
* `policies` (`Optional[Policy]`): If provided, this policy will be used for this scan *instead of* the client's default policy.
* **Platform Overrides**: `name`, `node_subtype`, `session_id`, `node_metadata`, `save`. These provide granular control for observability.

**Returns:** An `ApiResult` object.

### `check_prompt()` / `check_response()`

*Specialized methods for scanning a user prompt or an LLM response against the active policy.*

```python theme={null}
def check_prompt(self, prompt: str, *, policy: Optional[Policy] = None, ...) -> ApiResult
def check_response(self, response: str, *, policy: Optional[Policy] = None, ...) -> ApiResult
```

**Parameters:**

* `prompt` / `response` (`str`): The text to be scanned.
* `policy` (`Optional[Policy]`): Overrides the client's default policy for this scan.
* `asset_id` / `session_id` / `save`: **Platform Tier Only.** Overrides the client's defaults for this single call.

**Returns:** An `ApiResult` object.

***

### **Guardrail Decorators (Platform Tier Only)**

Guardrails are Python decorators used to automatically trace and protect functions within an agentic workflow. They log execution spans and can apply policies to function inputs and outputs.

### `guard_entrypoint()` / `guard_agent()` / `guard_tool()`

*These decorators wrap different components of your workflow for observability and protection.*

* `@client.guard_entrypoint()`: Use on the main function that starts your workflow.
* `@client.guard_agent()`: Use on functions that represent a distinct agent or logical step.
* `@client.guard_tool()`: Use on functions that act as tools (e.g., calling an API, querying a database). This is the most common decorator and can apply policies to the tool's inputs and outputs.

**Key Decorator Parameters:**

* `name` (`Optional[str]`): A custom name for the node in the trace. Defaults to the function name.
* `check_input_args` (`Optional[List[str]]`): A list of argument names whose string values should be scanned on function entry.
* `check_output` (`bool`): If `True`, the function's return value will be scanned.
* `policies` (`Optional[Policy]`): A specific policy to apply for the decorator's scans, overriding the client default.
* `callback` (`Optional[Callable[[GuardrailEvent], None]]`): Called after each input/output guardrail scan with a [`GuardrailEvent`](/sdk-reference/data/types#guardrailevent). See [Core Concepts — `callback` and `GuardrailEvent`](/docs/core/core-concepts#optional-callback-and-guardrailevent).

**Example:**

```python theme={null}
@client.guard_tool(
    name="GoogleSearch",
    check_output=True, # Scan the search results
    policies={PolicyName.BANNED_TOPICS: {"action": Action.FLAG, "topics": ["finance"]}}
)
def search_google(query: str) -> str:
    # ... logic to search google ...
    return results

# When called, the `results` will be automatically scanned for the "finance" topic.
search_google(query="What are the best stocks?")
```

***

### **Fine-Grained Scan Methods**

These methods are convenient shortcuts for checking a single, specific risk. They all accept optional platform `**kwargs` (`asset_id`, `session_id`, `save`).

### 1. `check_policy_violation()`

*Scans text against a custom list of keywords or rules.*

```python theme={null}
def check_policy_violation(self, text: str, interaction_type: InteractionType, action: Action, rules: List[str], **kwargs) -> ApiResult
```

* `rules` (`List[str]`): A list of forbidden words or phrases.

### 2. `check_secrets_keys()`

*Scans text for hardcoded secrets and keys. Primarily used for responses.*

```python theme={null}
def check_secrets_keys(self, text: str, action: Action, patterns: Optional[List[Tuple[str, str]]] = None, **kwargs) -> ApiResult
```

* `patterns` (`Optional[List[Tuple[str, str]]]`): A list of tuples, where each tuple contains `(name, regex_pattern)`, to whitelist specific patterns that might otherwise be flagged as secrets.

### 3. `check_pii()`

*Scans text for Personally Identifiable Information (PII) like emails, phone numbers, etc.*

```python theme={null}
def check_pii(self, text: str, interaction_type: InteractionType, action: Action, **kwargs) -> ApiResult
```

### 4. `check_toxicity()`

*Scans text for toxic content, including insults, threats, and profanity.*

```python theme={null}
def check_toxicity(self, text: str, interaction_type: InteractionType, action: Action, **kwargs) -> ApiResult
```

### 5. `check_competitor_mention()`

*Scans text for mentions of specific competitor names.*

```python theme={null}
def check_competitor_mention(self, text: str, interaction_type: InteractionType, action: Action, competitors: List[str], **kwargs) -> ApiResult
```

* `competitors` (`List[str]`): A list of competitor names to detect.

### 6. `check_banned_topics()`

*Scans a prompt to see if it pertains to forbidden topics.*

```python theme={null}
def check_banned_topics(self, prompt: str, action: Action, topics: List[str], **kwargs) -> ApiResult
```

* `topics` (`List[str]`): A list of forbidden topics (e.g., "weapons manufacturing", "illegal activities").

### 7. `check_prompt_injection()`

*Scans a prompt for common prompt injection attack patterns.*

```python theme={null}
def check_prompt_injection(self, prompt: str, action: Action, **kwargs) -> ApiResult
```

### 8. `check_unsafe_prompt()`

*Scans a prompt for requests that ask the LLM to generate harmful, unethical, or illegal content.*

```python theme={null}
def check_unsafe_prompt(self, prompt: str, action: Action, **kwargs) -> ApiResult
```

### 9. `check_unsafe_response()`

*Scans an LLM response to ensure it does not contain harmful, unethical, or illegal content.*

```python theme={null}
def check_unsafe_response(self, text: str, action: Action, **kwargs) -> ApiResult
```

### 10. `check_system_prompt_leak()`

*Scans an LLM response to check if it contains text from its own system prompt.*

```python theme={null}
def check_system_prompt_leak(self, text: str, action: Action, system_prompt: str, **kwargs) -> ApiResult
```

* `system_prompt` (`str`): The exact system prompt string to check against.

***

### **Client State Management Methods**

These methods allow you to inspect and modify the client's default configuration after it has been created.

### Policy Management

* `set_policies(policies_to_set: Policy)`: Updates the client's default policy.
* `get_enabled_policies() -> Policy`: Returns a dictionary of the currently active policies on the client.
* `clear_policies()`: Removes all default policies from the client.

### Asset Management (Platform Only)

* `set_asset_id(asset_id: str)`: Sets or changes the default `asset_id` for the client.
* `get_asset_id() -> Optional[str]`: Retrieves the current default `asset_id`.
* `clear_asset_id()`: Removes the default `asset_id` from the client.

### Session Management (Platform Only)

* `set_session_id(session_id: str)`: Sets or changes the default `session_id`.
* `get_session_id() -> Optional[str]`: Retrieves the current default `session_id`.
* `clear_session_id()`: Removes the default `session_id`.

**Example:**

```
# Platform Only
client.set_asset_id("new-asset-id")
print(f"Current asset: {client.get_asset_id()}")
client.clear_asset_id()
print(f"Asset after clearing: {client.get_asset_id()}")
```

***

### **Resource Management**

### `close()`

*Closes the client and its underlying network session. This is a crucial step to release resources gracefully.*

```
def close(self):
```

* ****`Always call close() when you are done with a client instance`****, either directly or by using a `try...finally` block. The client can also be used as a context manager (`with ArgusClient.create(...) as client:`), which will automatically call `close()` on exit.
