다음을 통해 공유


대화형 채팅 환경을 사용하여 Security Copilot 에이전트 빌드

Microsoft Security Copilot 대화형 에이전트를 만들려면 동적 작업 중심 대화를 지원하도록 에이전트를 구성해야 합니다. 최종 사용자는 에이전트와의 채팅 기능을 통해 에이전트와 상호 작용합니다. 이 기능을 사용하도록 설정하려면 에이전트 매니페스트에 필요한 특성을 추가합니다.

이 문서에서는 사용자에게 Microsoft Docs 학습 페이지의 공개 설명서를 사용하여 Security Copilot 사용하는 방법을 가르칠 수 있는 대화형 에이전트를 빌드하는 방법에 대한 연습을 제공합니다.

대화형 Security Copilot 에이전트를 빌드하는 단계

에이전트 매니페스트를 빌드하려면 매니페스트에서 대화형 에이전트 환경에 필요한 특성을 참조할 수 있습니다. 자세한 내용은 에이전트 매니페스트를 참조하세요.

대화형 에이전트 YAML

다음은 대화형 에이전트 매니페스트 YAML의 SecurityCopilotDocsAgent 샘플입니다.


Descriptor:
  Name: SecurityCopilotDocsAgent
  DisplayName: Security Copilot Docs Agent
  Description: >-
    Answers user questions about Microsoft Security Copilot by searching
    Microsoft Docs and returning relevant guidance.
  Icon: ''
AgentDefinitions:
  - Name: SecurityCopilotDocsAgent
    DisplayName: Security Copilot Docs Agent
    Description: >-
      Answers user questions about Microsoft Security Copilot by searching
      Microsoft Docs and returning relevant guidance.
    Publisher: Custom
    Product: SecurityCopilot
    RequiredSkillsets:
      - MCP.MSDocs
      - SecurityCopilotDocsAgent
    AgentSingleInstanceConstraint: None
    Triggers:
      - Name: Default
        DefaultPollPeriodSeconds: 0
        ProcessSkill: SecurityCopilotDocsAgent.SecurityCopilotDocsAgent
    PromptSkill: SecurityCopilotDocsAgent.SecurityCopilotDocsAgent  # Added for interactive agent experience
SkillGroups: 
  - Format: Agent
    Skills:
      - Name: SecurityCopilotDocsAgent
        DisplayName: Security Copilot Docs Agent
        Description: Uses Microsoft Docs to answer questions about Security Copilot usage.
        Interfaces:
        - InteractiveAgent   # Added for interactive agent experience
        Inputs:
          - Name: UserRequest     # Input to the prompt skill (must always be named UserRequest) 
            Description: The user's question about how to use Microsoft Security Copilot.
            DefaultValue: ''
            Required: true
        SuggestedPrompts:    # Starter prompts
        - Prompt: Show me areas in which Security Copilot can help me?
          Title: Security Copilot Overview
          Personas:
          - 3
          IsStarterAgent: true
        - Prompt: How do I build agents in Security Copilot?
          Title: Building Agents
          Personas:
          - 3
          IsStarterAgent: true
        - Prompt: How do I get details on a specific Defender incident?
          Title: Incident Knowledge
          Personas:
          - 3
          IsStarterAgent: true
        - Prompt: How do I execute a KQL query via Security Copilot?
          Title: KQL Query
          Personas:
          - 3
          IsStarterAgent: true
        - Prompt: Give me more details on the above   # Prompt suggestions
        - Prompt: Where do I get troubleshooting information
        - Prompt: My prompt is not giving the response I am seeking, how can I improve on it.
        - Prompt: What is a ProcessSkill in an Agent and show is it different from PromptSkill
        - Prompt: How do I import a custom plugin?
        - Prompt: Does Security Copilot support MCP?
        - Prompt: How do I build an API plugin?
        - Prompt: How do I build a promptbook?
        - Prompt: Can I run a Security Copilot prompt from LogicApp?
        - Prompt: Can I execute a Security Copilot agent from LogicApp?
        - Prompt: What is the purpose of a trigger in Agents?
        
        Settings:
          OrchestratorSkill: DefaultAgentOrchestrator
          Instructions: >
            # Mission You are an expert assistant for Microsoft Security
            Copilot. When a user asks a question about how to use Security
            Copilot, search Microsoft Docs for the most relevant and up-to-date
            guidance. Make sure to return data relevant to Microsoft Security Copilot specifically. 

            # Data Handling Use the AskMsDocs skill to search Microsoft
            documentation for Security Copilot and related topics. Summarize the
            most relevant information and provide clear, actionable answers.

            # Workflow 1. Receive the user's question as input. 2. Call the
            AskMsDocs skill with the user's question. 3. Review the returned
            documentation results. 4. Summarize the key guidance and steps for
            the user. 5. If the answer is not found, state that no relevant
            documentation was found.

            # Output Provide a concise, accurate answer with references to
            Microsoft Docs where possible.
        ChildSkills:
          - microsoft_docs_search

에이전트 매니페스트를 구성하고 대화형 에이전트를 빌드하는 단계는 다음과 같습니다.

1단계: 대화형 에이전트 계획

대화형 에이전트는 에이전트와 사용자가 단계별 환경을 위해 협업하여 문제를 해결해야 할 때 유용합니다. 대화형 에이전트의 목표와 지침을 명확히 하고, 사용할 수 있는 도구(기술)를 지정하고, 사용자 요청을 처리하는 방법을 정의합니다.

2단계: 프롬프트 기술 추가

특성은 PromptSkill 사용자 요청을 처리하는 데 사용할 목표, 지침 및 기능을 지정하여 사용자 환경을 정의합니다. 에이전트(권장), GPT, KQL 및 API 등 다양한 유형의 도구(기술)를 참조할 수 있습니다. 다양한 도구 유형을 만드는 방법에 대한 자세한 내용은 도구를 참조 하세요.

  1. PromptSkill 에이전트 매니페스트에 특성을 추가합니다. 그러면 에이전트와 채팅 옵션이 만들어집니다.

  2. PromptSkill은 로 SkillsetName.SkillName형식이 지정되어야 합니다. 다음은 특성에 대한 PromptSkill 에이전트 매니페스트의 샘플 섹션을 보여 줍니다. 여기서 SkillsetName = SecurityCopilotDocsAgent( Descriptor.nameSkillName = SecurityCopilotDocsAgent)는 기술에 정의되어 Format: Agent 있습니다.

     PromptSkill: SecurityCopilotDocsAgent.SecurityCopilotDocsAgent
    
  3. 에이전트 정의에서 가 있는 AgentDefinition 기술 세트의 이름과 에 대한 ChildSkills기술 세트를 지정해야 합니다. 필드에 모두 RequiredSkillsets 나열합니다.

  4. Interfaces 에이전트 기술 설명자에 필드를 포함합니다. 대화형 에이전트의 경우 인터페이스를 로 InteractiveAgent설정합니다.

  5. UserRequest 은 에 대한 입력으로 추가됩니다 PromptSkill.

3단계: 프롬프트 추가

시작 프롬프트

시작 프롬프트는 컨텍스트를 설정하는 데 도움이 되며 대화형 에이전트 환경의 시작 부분에 표시됩니다. 사용자가 에이전트가 수행할 수 있는 작업을 이해하고 기대치를 설정하는 데 도움이 됩니다.

시작 프롬프트를 구성하려면 다음을 수행합니다.

  1. 특성은 SuggestedPrompts 플래그가 있는 선언 IsStarterAgent 에 사용됩니다.

  2. Title 정의하면 Personas 프롬프트가 정렬됩니다.

다음은 대화형 에이전트 환경 내에만 표시되는 시작 프롬프트에 대한 에이전트 매니페스트의 샘플 섹션을 보여 줍니다.

     SuggestedPrompts:
        - Prompt: Show me areas in which Security Copilot can help me?
          Title: Security Copilot Overview
          Personas:
          - 3
          IsStarterAgent: true

이 프롬프트는 의 가상 사용자 유형을 ITAdmin 선택한 경우에만 표시됩니다.

가상 사용자 유형 ID는 다음과 같습니다.

ID 가상 사용자 유형
0 CISO
1 SCO 분석가
2 위협 인텔 분석가
3 ITAdmin
4 ID 관리
5 데이터 보안 관리
6 클라우드 관리

에이전트 매니페스트의 SecurityCopilotDocsAgent대화형 에이전트 섹션에서 에이전트 기술에는 다른 가상 사용자에 할당된 4개의 시작 프롬프트가 표시됩니다.

다음 이미지는 에이전트와의 상호 작용을 시작하도록 선택할 수 있는 시작 프롬프트를 보여 줍니다.

시작 프롬프트 기능을 표시하는 이미지

프롬프트 제안

프롬프트 제안은 프롬프트 의 출력이 표시된 후 후속 프롬프트의 큐레이팅된 목록입니다. 제안을 통해 사용자는 단계별 환경 내에 머무를 수 있습니다.

프롬프트 제안을 구성하려면 다음을 수행합니다.

  1. 프롬프트 특성이 있는 기술 SuggestedPrompts 아래에 추가됩니다.

    • IsStarterAgentPersonas 는 프롬프트 제안을 생략하여 시작 프롬프트로 처리되지 않도록 해야 합니다.
  2. 특성 아래의 모든 프롬프트는 SuggestedPrompts 세션의 컨텍스트에 따라 프롬프트를 생성하고 순위를 지정합니다. 이러한 프롬프트는 를 시작 템플릿으로 사용하여 SuggestedPrompts 생성됩니다.

  3. 프롬프트 제안은 채팅 대화를 계속할 수 있는 잠재적 프롬프트로 결과에 표시됩니다.

  4. 프롬프트 제안을 선택하는 경우 제출하기 전에 프롬프트를 편집할 수 있습니다.

  5. 요청이 실행되고 응답이 반환됩니다.

참고

동적으로 생성된 프롬프트 제안에서 필요한 도구를 사용하는 경우 Orchestrator는 검사 않습니다. 도구를 사용하도록 설정하지 않은 프롬프트가 실행되면 오류가 표시됩니다. 모든 관련 도구를 사용하도록 설정하고 구성했는지 확인합니다.

다음 YAML은 에이전트 매니페스트의 샘플 섹션을 보여 줍니다. 여기서 SecurityCopilotDocsAgent 에는 동적 제안된 프롬프트를 생성하는 템플릿으로 사용할 11개의 제안된 프롬프트가 있습니다.


        - Prompt: Give me more details on the above
        - Prompt: Where do I get troubleshooting information
        - Prompt: My prompt is not giving the response I am seeking, how can I improve on it.
        - Prompt: What is a ProcessSkill in an Agent and show is it different from PromptSkill
        - Prompt: How do I import a custom plugin?
        - Prompt: Does Security Copilot support MCP?
        - Prompt: How do I build an API plugin?
        - Prompt: How do I build a promptbook?
        - Prompt: Can I run a Security Copilot prompt from LogicApp?
        - Prompt: Can I execute a Security Copilot agent from LogicApp?
        - Prompt: What is the purpose of a trigger in Agents?

다음 이미지는 프롬프트가 처리되고 결과가 반환된 후 생성된 프롬프트 제안을 보여 줍니다.

프롬프트 제안 기능을 표시하는 이미지

4단계: 지침 제공

Instructions 은 에이전트에게 주어진 지침으로, 목표를 정의하고, 요청 및 워크플로를 처리하는 방법, 제한 사항 및 결과를 자세히 설명합니다.

샘플에서 에이전트에 대해 제공된 Instructions 세부 정보를 참조하세요.

5단계: 자식 기술 설정

자식 기술은 결과를 예측 가능하고 포괄적으로 만들기 위해 에이전트가 적용할 수 있는 도구와 기능입니다. 도구(기술)는 특정 작업을 수행하고 에이전트가 목표를 달성하기 위해 호출합니다.

샘플에서 는 microsoft_docs_search 아래에 정의된 MCP 플러그 인 MCP.MSDocs 입니다 RequiredSkillsets.


  ChildSkills:
        - microsoft_docs_search

6단계: YAML 업로드

필요한 특성을 사용하여 에이전트 YAML 매니페스트를 구성한 후에는 에이전트와 채팅 기능을 사용할 수 있도록 YAML을 업로드해야 합니다.

알려진 제한

대화형 에이전트를 구현하기 위한 알려진 제한 사항은 다음과 같습니다.

  • 대화형 에이전트는 하나의 입력만 지원하며, 이 입력은 UserRequest이어야 합니다.

  • 사용자는 에이전트와의 채팅 을 선택하고 ID 및 동의를 사용하여 인증하여 대화형 채팅을 설정할 수 있습니다. 이렇게 하면 다른 사용자가 사용할 에이전트가 설정되지 않습니다. 적절한 사용자는 다른 사용자가 이 에이전트를 사용할 수 있도록 Active Agents에서 에이전트를 설정해야 합니다.

  • 에이전트 메모리는 채팅 컨텍스트에 포함되지 않습니다.

테스트 프롬프트

  • 프롬프트를 시작 프롬프트로 정의하기 전에 새 세션에서 프롬프트를 첫 번째 프롬프트로 실행하고 오류가 없고 프롬프트 출력이 유효한지 확인합니다.

  • 모든 프롬프트가 시작 프롬프트로 사용되는 데 적합한 것은 아닙니다. 예를 들어 이전 컨텍스트가 필요한 프롬프트는 이러한 프롬프트가 올바르게 작동하는 데 사용할 수 있는 컨텍스트가 없으므로 시작 프롬프트에 적합하지 않습니다.

다음 단계