가드레일 공급자: Cato Networks

가드레일 공급자: Cato Networks

출처: 문서

본문

빠른 시작 (Quick Start)

1. 새 Cato Networks AI Security Guard 만들기

Cato Networks CMA로 가서 새 AI Security guard를 만드세요.

Guard 이름을 정하고 AI Gateway 옵션을 선택하세요.

info

LiteLLM을 가상 키와 함께 사용할 때는 가상 키 별칭을 guard의 이름으로 사용해 키별 정책을 설정할 수 있어요. 가상 키의 별칭만(실제 키 시크릿은 아님) Cato Networks로 보내져요.

2. Cato Networks AI Security Guard 정책 구성

어떤 탐지를 활성화할지 선택하는 Engine Profile을 만드세요. 이 Engine Profile과 Guard를 참조하는 Guard Policy 규칙을 만들고 적용할 동작을 구성하세요.

3. LiteLLM config.yaml에 Cato Networks Guardrail 추가

guardrails 섹션 아래에 가드레일을 정의하세요.

model_list:
  - model_name: gpt-5.6-luna
    litellm_params:
      model: openai/gpt-5.6-luna
      api_key: os.environ/OPENAI_API_KEY
guardrails:
  - guardrail_name: cato-protected-app
    litellm_params:
      guardrail: cato_networks
      mode: [pre_call, post_call] # "During_call" is also available
      api_key: os.environ/CATO_API_KEY
      api_base: os.environ/CATO_API_BASE
      ssl_verify: False # Optional, set to False to disable SSL verification or a string path to a custom CA bundle
      inspect_embeddings: false # Optional, set to true to inspect /embeddings input

api_key 아래에 발급받은 API 키를 넣으세요. 키는 guard의 페이지에서 찾을 수 있어요. CATO_API_KEY를 환경 변수로도 설정할 수 있어요.

기본적으로 api_basehttps://api.aisec.catonetworks.com으로 설정돼요. 리전에 맞는 올바른 URL을 설정하세요. 자체 호스팅 Outpost를 사용한다면 api_base를 Outpost URL로 설정할 수 있어요.

4. LiteLLM 게이트웨이 시작

litellm --config config.yaml

5. 첫 요청 보내기

note

다음 예시는 policy에서 PII 탐지를 활성화하는 것에 달려 있어요. 다른 guard 정책과 일치하도록 요청 콘텐츠를 조정할 수 있어요.

성공적으로 차단된 요청:

note

LiteLLM을 가상 키와 함께 사용할 때는 가상 키가 있는 Authorization 헤더가 필요해요.

curl -i http://localhost:4000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ***" \
  -d '{
    "model": "gpt-5.6-luna",
    "messages": [
      {"role": "user", "content": "hi my email is [email protected]"}
    ],
    "guardrails": ["cato-protected-app"]
  }'

올바르게 구성했다면, [email protected]가 Cato Networks AI Security Guard에 의해 PII로 감지되므로 400 Bad Request 상태 코드와 함께 다음과 유사한 응답을 받게 돼요:

{
  "error": {
    "message": "\"[email protected]\" detected as email",
    "type": "None",
    "param": "None",
    "code": "400"
  }
}

성공적으로 허용된 요청:

note

LiteLLM을 가상 키와 함께 사용할 때는 가상 키가 있는 Authorization 헤더가 필요해요.

curl -i http://localhost:4000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-luna",
    "messages": [
      {"role": "user", "content": "hi what is the weather"}
    ],
    "guardrails": ["cato-protected-app"]
  }'

위 요청은 차단되지 않아야 하고, 일반적인 LLM 응답을 받아야 해요 (간결히 단순화):

{
  "model": "gpt-5.6-luna",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "I can’t provide live weather updates without the internet. Let me know if you’d like general weather trends for a location and season instead!",
        "role": "assistant"
      }
    }
  ]
}