Skip to main content
All CollectionsBuild AutomationsOperators
AI Task Operator: Execute AI-Powered Tasks Seamlessly
AI Task Operator: Execute AI-Powered Tasks Seamlessly

Use the AI Task operator to effortlessly incorporate large language models (LLMs) into Torq workflows—no integration needed.

Updated over a week ago

Use the AI Task operator to incorporate the power and capabilities of large language models (LLMs) at any workflow stage. Simply add the operator, enter your prompt, and select the most suitable model—GPT-4o, GPT-4 Turbo, Gemini 1.5 Pro, or Gemini 1 Pro. Powered by Torq’s AI subscription, the operator requires no integration, streamlining operational efficiency across various SecOps use cases.

  • The AI Task operator runs on a monthly credit system and is available to organizations that have opted into Torq AI features.

  • As with Torq's other responsible AI products, no data inputted into the AI Task operator will be used for training.

How to Use

  1. Add the Operator to the Canvas: Drag the AI Task operator onto the workflow canvas.

  2. Provide a Prompt: In the Prompt parameter, describe your desired action in natural language.

    • The AI Task operator supports multiple languages. See each individual LLM's documentation for details.

    • The Prompt parameter is dynamic—you can pass values from the workflow metadata or context using the {{ $. }} notation.

    • The AI Task operator cannot access information from your workspace or organization except what is directly passed to it.

  3. Pick a Model: In the Model dropdown, select which LLM you would like to process your task. The options are:

  4. Set the Temperature: Add the Temperature optional parameter to control the consistency of the model responses.

    Due to the nature of AI and LLMs, it cannot be guaranteed that the LLM will return the same output each execution, even with an identical prompt.

    • The Temperature parameter ranges from 0 to 1, controlling response randomness. The default temperature is 0.

    • Lower values like 0.2 produce more consistent results.

    • Higher values like 0.8 increase variability.

  5. Test and Refine: Execute the step to test the output. Adjust the prompt and temperature accordingly, and test again as desired.

    • Test executions consume execution credits.

  6. Pass the Output Onward: Access the AI Task response in subsequent steps using {{ $.run_task_with_ai.response }}.

    • Credit usage information is also available after the operator's execution:

      • {{ $.run_task_with_ai.usage.remaining_credits }} - the workspace's remaining credits.

      • {{ $.run_task_with_ai.usage.renews_at }} - the date the credit count renews.

      • {{ $.run_task_with_ai.usage.used_credits }} - the amount of credits used in the operator's latest execution.

Use Case Examples

These examples highlight a few use cases for the AI Task operator.

Automated Content Analysis

Use the AI Task operator to automatically analyze text, identify patterns, and classify information for initial assessment.

Example: Analyzing a Suspicious Email

  1. A user reports an email as suspicious.

  2. The AI Task operator analyzes the email content and headers to determine its legitimacy.

    • If the email is legitimate, it returns BENIGN.

    • If the email exhibits phishing characteristics, it returns SUSPICIOUS, followed by an explanation.

The AI Task operator is prompted as follows:

You will be provided with a text which is an email received by one of our
employees. Please analyze the text and suggest if it is a legitimate email
or a phishing attempt. Please begin your response with a single word
either BENIGN or SUSPICIOUS and then provide the reasoning. Format the
response as HTML but don't provide any indication of the output format in
the response.

Following is an email text:
{{ $.escape_json_text.result }}

Text Translation

Use the AI Task operator to translate text from one language to another, enabling smooth communications.

Example: Translating a Suspicious Email

  1. A user reports an email as suspicious.

  2. The AI Task operator first checks if the content is in English.

    • If the email is in English, it returns English as the output.

    • If the email is in another language, it translates the content and provides the translation for further analysis.

The AI Task operator is prompted as follows:

You will be provided with a text. Check if the text is written in English.
If yes, then return the word "English" as your only response.
If not, translate the text into English and format the response as HTML.
Don't provide any explanations nor any indication of the output format in
the response.

Following is an email body text:
{{ jsonEscape $.get_email_body_content.api_object }}

Information Consolidation

Use the AI Task operator to process and synthesize data from multiple sources, unifying information into a single, informed summary.

Example: Consolidating Threat Intelligence Reports

  1. An IP address is enriched with three different vendors (such as VirusTotal, AlienValut, or Recorded Future).

  2. The AI Task operator digests the enrichment results and combines them into one summary.

  3. The operator's output is then sent via Slack to the relevant stakeholders.

The AI Task operator is prompted as follows:

Take these summaries and consolidate into one summary. Add insights if
there are any about the threat level of the IPs presented and malware
families.
{{$.cybersixgill_ioc_enrichment.api_object.items}}
{{$.recorded_future_ioc_enrichment.api_object.data}}
{{$.virustotal_ioc_enrichment.api_object.items}}
Did this answer your question?