Fortinet FortiAIGate
Fortinet FortiAIGate is an inline AI gateway that brokers and guards access to large language model providers.
fortinet-fortiaigate_1.7.1.tgz
Community code that runs on your platform. A maintainer reviewed this exact source; the download is rebuilt from it. Follow the to install it.
Manage a FortiAIGate inline AI gateway from FortiSOAR: the virtual keys client applications use to reach the gateway's OpenAI-compatible endpoint, and the guardrails and policies that govern them.
Actions list workspaces; list, get, create, update, rotate, renew and revoke virtual keys; list the keys that
expire within N days; check a key against the data plane; send guarded chat completions; list guardrails and
scan text with them without calling a model; list and attach policies; read provider health, workspace budgets
and the admin audit log; and call any other management endpoint with Execute API Request, which refuses a
full URL so the login never leaves the configured server. Renew Virtual Key keeps the key's id, name,
limits, policies and model access: it moves an expiry that would come too soon out, extends an expired key, and
rotates it. A revoked key is never brought back.
The included playbooks keep app keys stored in HashiCorp Vault (with the HashiCorp Vault KV connector,
1.2.1 or later) renewed before they expire, without SOAR ever reading a secret. Each Vault secret is tagged in
its custom metadata with the key it holds. Renew Expiring FortiAIGate Keys in Vault (run it on a schedule)
finds the keys expiring within two days, matches them to the tagged secrets in a folder, renews each one and
writes only the new api_key back. A key no secret is tagged with is left to expire, and a key tagged on two
secrets is reported, not touched. Onboard FortiAIGate Key to Vault is an API endpoint that creates a key
for a new app, stores it tagged in a new secret and returns the key name and Vault path. The README lists the
Vault policy and permissions these need. FortiAIGate > Ingest (1.7.0) pulls the gateway's blocked requests
on a schedule and files them as alerts, so guardrail denials become records the revocation playbook can act on:
posting a block's request_id and key_id to its API endpoint revokes the key, clears its Vault secret and
rotates the workspace's other keys, refusing replays older than 15 minutes and re-processing the same block
only once.
Configuration · 7 fields
- Server URL
servertext requiredBase URL of the FortiAIGate management console. The connector logs in with the credentials below, then calls the JSON API under /api/v1.
- Username
usernametext requiredUsername of a FortiAIGate account: an organization administrator, or a workspace admin or member. The connector detects which: an organization administrator manages every workspace (the /api/v1/admin API); any other login manages its own workspace (/api/v1/workspaces/<id>).
- Password
passwordpassword requiredPassword of the FortiAIGate account.
- Workspace
workspacetext(Optional) For a workspace login only: the name or id of the workspace the connector acts in. Leave it blank when the account is a member of one workspace; it is then used automatically. An organization administrator ignores it.
- Verify SSL
verify_sslcheckboxSpecifies whether the SSL certificate of the FortiAIGate server is to be verified. The workshop/lab gateway serves a self-signed certificate, so leave this unchecked there.
Default
true - Data Plane Base URL
data_plane_basetextOptional base URL used for validating API keys against the data plane. Defaults to the same origin as the management Server URL. Only set this when the data plane is published at a different address.
- Request Timeout (seconds)
timeouttextPer-request timeout in seconds applied to every management and data-plane HTTP call.
Default
30
Operations · 30
List Workspaces
list_workspaceslist_workspacesList the FortiAIGate workspaces: every workspace for an organization administrator, the login's own workspaces otherwise. Virtual keys are created inside a workspace, so use this to resolve a workspace_id for the Create Virtual Key operation.
No parameters.
ReturnstypeitemsList Virtual Keys 2 params
list_virtual_keyslist_virtual_keysList the virtual keys on the FortiAIGate gateway. Optionally filter by workspace or status. Each record includes the key id, name, active status, expiry (expiresAt), usage (lastUsedAt, spend) and the secret preview - the secret itself is never returned by the management API.
- Workspace ID
workspace_idselect(Optional) Only list virtual keys in this workspace.
- Status
statusselect(Optional) Only list virtual keys with this status.
Options activerevokedsuspended
ReturnstypeitemsList Expiring Virtual Keys 3 params
list_expiring_virtual_keyslist_expiring_virtual_keysList the virtual keys that expire within a number of days, soonest first, and (by default) those that already have. A key with no expiry, and a revoked or suspended key, is never listed. Feed the key ids to a renewal flow.
- Workspace ID
workspace_idselect(Optional) Only keys in this workspace. Empty lists every key the login can see.
- Within (Days)
within_daystext(Optional) List keys that expire within this many days from now. Default 7; 0 lists only expired keys.
- Include Expired
include_expiredcheckboxAlso list keys that have already expired. Default on.
Default
true
ReturnstypepropertiesGet Virtual Key 1 param
get_virtual_keyget_virtual_keyRetrieve a single virtual key record by its id.
- Key ID
key_idselect requiredUUID of the virtual key to retrieve.
ReturnstypepropertiesCreate Virtual Key 7 params
create_virtual_keycreate_virtual_keyCreate a new virtual key in a workspace. FortiAIGate returns the key secret (secretKey) exactly once, in the response to this operation - it is never readable again, so store it immediately (for example in HashiCorp Vault).
- Workspace ID
workspace_idselectWorkspace in which to create the key. Resolve with List Workspaces. Required for an organization administrator; a workspace login defaults to its workspace.
- Key Name
key_nametext requiredDisplay name of the new virtual key.
- Expires At
expires_attext(Optional) Expiry timestamp in ISO 8601. Leave empty for a key that does not expire.
- Expires In (Days)
expires_in_daystext(Optional) Expire the key this many days from now. Ignored when Expires At is set.
- TPM
tpmtext(Optional) Tokens-per-minute limit for the new key.
- RPM
rpmtext(Optional) Requests-per-minute limit for the new key.
- Providers
provider_idstext(Optional) AI provider ids the key may use, comma-separated; the key gets every model of each. FortiAIGate 8.0.2 requires model access, so a key created without it is refused.
ReturnstypepropertiesUpdate Virtual Key 5 params
update_virtual_keyupdate_virtual_keyUpdate the expiry or the TPM/RPM limits of a virtual key. The management API replaces the whole key configuration on update, so this operation first reads the current record and merges in only the fields you supply - everything else is preserved.
- Key ID
key_idselect requiredUUID of the virtual key to update.
- Expires At
expires_attext(Optional) New expiry timestamp in ISO 8601. Leave empty to keep the current value.
- TPM
tpmtext(Optional) New tokens-per-minute limit. Leave empty to keep the current value.
- RPM
rpmtext(Optional) New requests-per-minute limit. Leave empty to keep the current value.
- Policy IDs
policy_idsmultiselect(Optional) Comma-separated policy ids to attach to the key. Replaces the current attached policy list; policies the organization forces onto the workspace always stay attached.
ReturnstypepropertiesRotate Virtual Key 2 params
rotate_virtual_keyrotate_virtual_keyRotate a virtual key in place: FortiAIGate invalidates the old secret and issues a new one for the same key id. Pass either the key (id or name), or the key secret itself (api_key); the connector derives the id from the secret. The response carries the new secret as secretKey - store it immediately (for example by writing it to HashiCorp Vault), as it is not readable again.
- Key ID
key_idselect(Optional) UUID of the virtual key to rotate. Leave empty when passing the key secret instead.
- API Key
api_keypassword(Optional) The virtual key secret itself; the connector derives the key id from it. Starts with 'faig_'.
ReturnstypepropertiesRenew Virtual Key 3 params
renew_virtual_keyrenew_virtual_keyGive a virtual key a new secret, keeping its id, name, limits, policies and model access. The expiry moves to Extend By (Days) from now when it would come sooner - so a key renewed ahead of its expiry does not expire anyway days later - and is never shortened. An expired key is extended first, because FortiAIGate only rotates an active key. A key with no expiry is only rotated. A revoked or…
- Key ID
key_idselect(Optional) The virtual key to renew, by name or id. Leave empty when passing the key secret instead.
- API Key
api_keypassword(Optional) The virtual key secret itself; the connector derives the key id from it. Starts with 'faig_'.
- Extend By (Days)
expires_in_daystext(Optional) New expiry this many days from now, applied when the key would expire sooner. Default 30, at most 3650.
ReturnstypepropertiesRevoke Virtual Key 2 params
revoke_virtual_keyrevoke_virtual_keyRevoke a virtual key. After revocation the key secret stops working on the data plane; the record remains visible with status 'revoked'.
- Key ID
key_idselect requiredUUID of the virtual key to revoke.
- Reason
reasontext(Optional) Why the key is being revoked; FortiAIGate records it with the revocation. Defaults to 'Revoked from FortiSOAR'.
ReturnstypepropertiesCheck API Key 1 param
check_keycheck_keyValidate a virtual key secret against the data plane by calling the OpenAI-compatible models endpoint with it. Returns valid=true with the model count on success (HTTP 200), or valid=false with the HTTP status for a rejected key (401/403 for expired, revoked or suspended keys). This is the preferred 'is this key expired?' detector in rotation playbooks.
- API Key
api_keypassword requiredThe virtual key secret to validate (starts with 'faig_').
ReturnstypepropertiesChat Completion 5 params
chat_completionchat_completionRun one OpenAI-compatible chat completion through the FortiAIGate data plane using a virtual key. Guardrails and policies attached to the key's workspace are enforced by the gateway, so playbook AI steps inherit its scanning and blocking. Returns the OpenAI-format completion: the assistant text is at choices[0].message.content, and a blocked prompt comes back with finish_reason content_filter.
- API Key
api_keypassword requiredThe virtual key secret to authenticate with (starts with 'faig_').
- Model
modelselect requiredModel to complete with, e.g. openai-gpt-4.1-mini. Use List Models on the data plane (Check API Key also returns the count) or the provider catalog naming.
- Messages (JSON)
messagestext requiredChat messages as a JSON list, e.g. [{"role": "user", "content": "Summarize this alert."}]
- Max Tokens
max_tokenstext(Optional) Maximum completion tokens.
- Temperature
temperaturetext(Optional) Sampling temperature, 0.0 to 2.0.
ReturnstypepropertiesTest Guardrail 4 params
test_guardrailtest_guardrailScan arbitrary text through the gateway's guardrail scanner. No provider or upstream model is involved: the operation answers 'would these detectors fire?'. Pass detector ids directly, or a guardrail id to reuse its detectors and character-deny setting. Use it to triage prompts and model outputs inside playbooks.
- Input Text
input_texttextarea requiredThe text to scan (a prompt, a model response, an email body).
- Detector IDs
detector_idsmultiselect(Optional) Comma-separated detector ids to run.
- Guardrail ID
guardrail_idselect(Optional) Test with this guardrail's detectors and deny-suspicious-characters setting.
- Deny Suspicious Characters
deny_suspicious_characterscheckbox(Optional) Deny Suspicious Characters
ReturnstypepropertiesList Policies 1 param
list_policieslist_policiesList the organization's AI policies with their guardrail assignments, provider access and status. With workspace_id, also includes that workspace's own policies.
- Workspace ID
workspace_idselect(Optional) Also list this workspace's own policies.
ReturnstypeitemsGet Policy 1 param
get_policyget_policyRetrieve a single policy by id, including input and output guardrail ids, provider access and any pending change.
- Policy ID
policy_idtext requiredUUID of the policy.
ReturnstypepropertiesList Guardrails
list_guardrailslist_guardrailsList the organization's guardrails (named detector sets) with their detector ids and the number of policies using each.
No parameters.
ReturnstypeitemsGet Guardrail 1 param
get_guardrailget_guardrailRetrieve a single guardrail by id, including its detector ids and deny-suspicious-characters setting.
- Guardrail ID
guardrail_idtext requiredUUID of the guardrail.
ReturnstypepropertiesList AI Providers
list_ai_providerslist_ai_providersList the AI providers the gateway can reach, with their platform, base URL, model counts and configured key counts. Useful when keys fail because an upstream provider is down or out of keys. Needs an organization administrator.
No parameters.
ReturnstypeitemsGet Workspace Budget 1 param
get_workspace_budgetget_workspace_budgetGet a workspace's spend against its budget and the budget cycle.
- Workspace ID
workspace_idselectUUID of the workspace. Resolve with List Workspaces. Required for an organization administrator; a workspace login defaults to its workspace.
ReturnstypepropertiesList Audit Logs 3 params
list_audit_logslist_audit_logsList the gateway's administration audit events (logins, key and policy changes), newest first. Returns the items, the total on the first page, and nextCursor (pass it back as Cursor for the next page).
- Cursor
cursortext(Optional) The nextCursor of the previous page. Leave empty for the first page.
- Range
rangeselect(Optional) The period to list: the last 24 hours, 7 days, month, or all. Default all.
Default
allOptions 24h7dmonthall - Limit
limittext(Optional) Page size, default 25.
ReturnstypepropertiesGet Traffic Log 1 param
get_traffic_logget_traffic_logFetch one traffic-log record by its request id (uuid). Returns the virtual key that sent the request, the gateway's verdict and the detectors that fired, so the revocation playbook can confirm a guardrail block before acting.
- Request Id
request_idtext requiredThe traffic log's uuid (the FortiAIGate request id).
Get Audit Log Filter Options
get_audit_log_filter_optionsget_audit_log_filter_optionsThe filter dimensions available for the audit log (users, workspaces, roles, actions), for building dashboards and picklists.
No parameters.
ReturnstypepropertiesGet Blocked Traffic 5 params
get_blocked_trafficget_blocked_trafficRead the requests FortiAIGate blocked, newest first. Each record has the prompt, the response if any, the detectors that fired (name, type, side, details), the reason, the sending virtual key (name, prefix, id, status) and the key's owner. Since (the last pull time, epoch milliseconds or an ISO 8601 datetime) with an optional Until reads a custom window; without Since, Range counts back from…
- Since
sincetext(Optional) Only blocked requests at or after this time: epoch milliseconds or an ISO 8601 datetime such as 2026-10-15T10:00:00Z. A poller passes its last pull time here. Blank reads the Range instead.
- Until
untiltext(Optional) The end of the window that starts at Since: epoch milliseconds or an ISO 8601 datetime. Default now. Needs Since.
- Range
rangeselect(Optional) Used when Since is blank: the last 24 hours, 7 days, month, or all. Default 24h.
Default
24hOptions 24h7dmonthall - Max Items
max_itemstext(Optional) Most blocked requests to read, newest first. Default 100. Each one costs a request to FortiAIGate.
Default
100 - Workspace ID
workspace_idselect(Optional) Only blocked requests in this workspace. Leave empty for every workspace the login can see.
ReturnstypeitemsList My Workspaces
list_my_workspaceslist_my_workspacesList the workspaces the configured administrator account is a member of. Create Virtual Key requires the key owner to be a member of the target workspace, so use this to pick a workspace id for key creation.
No parameters.
ReturnstypeitemsGet Workspace Options
get_workspace_optionsget_workspace_optionsPopulates workspace dropdowns with plain names: every workspace for an organization administrator, the login's own workspaces otherwise. The action resolves the picked name to the workspace id.
No parameters.
ReturnstypeitemsGet Virtual Key Options
get_virtual_key_optionsget_virtual_key_optionsPopulates virtual key dropdowns with plain key names (renewed keys keep their name; when two keys share a name the one active key is used). The action resolves the picked name to the key id.
No parameters.
ReturnstypeitemsGet Policy Options
get_policy_optionsget_policy_optionsPopulates policy dropdowns with plain policy names. The action resolves the picked name to the policy id.
No parameters.
ReturnstypeitemsGet Guardrail Options
get_guardrail_optionsget_guardrail_optionsPopulates guardrail dropdowns with plain guardrail names. The action resolves the picked name to the guardrail id.
No parameters.
ReturnstypeitemsGet Detector Options
get_detector_optionsget_detector_optionsPopulates detector dropdowns with plain detector names: the built-in detectors, then the custom detectors. The action resolves the picked name to the detector id.
No parameters.
ReturnstypeitemsGet Model Options
get_model_optionsget_model_optionsPopulates the chat completion model dropdown with the public model names of the model groups the login can use (the identifiers the completions endpoint accepts). Empty when the login has no model group; type the model name then.
No parameters.
ReturnstypeitemsExecute API Request 4 params
execute_api_requestexecute_api_requestCalls any FortiAIGate management API endpoint with the configured login. A full URL is refused so the credentials only ever go to the configured server.
- Endpoint
endpointtext requiredPath on the configured FortiAIGate server, for example /api/v1/admin/workspaces.
- Method
methodselectHTTP method. Defaults to GET.
Default
GETOptions GETPOSTPUTPATCHDELETE - Query Parameters
query_paramsjson(Optional) JSON object of query string parameters.
- Request Body
request_bodyjson(Optional) JSON object sent with POST, PUT and PATCH.