web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / SharePoint Knowledge s...
Copilot Studio
Suggested Answer

SharePoint Knowledge source

(0) ShareShare
ReportReport
Posted on by 31
I have created 2 copilot studio agents to answer user queries related to HR policies both are pointing to the same SharePoint knowledge source but behave differently. I want to provide custom message for scenarios like
    • Whenever user does not have access to SharePoint site he must receive message that “You do not have permission to SharePoint site. Kindly contact site owner or HR support team.”
    • Whenever user query is relevant and also has access to SharePoint site but answer is not found he should get message “Could not located the requested information please try rephrasing your query”
    • Whenever user wants any manual assistance, he will get message “I could not help with manual intervention. Please ask queries related to HR Policies only.”
 
  1. One provides right answer, but it cannot identify the SharePoint access scenarios and always move to fallback topic without any error and shows message configured in topic.
 

  1. The second agent does not provide any answer and always display custom message “Please check SharePoint permission”

Could anyone please guide or help to understand this behavior to me to how can I make this agent consistent in identifying custom message scenarios and also provide right answer if all is ok.
 
 

 

I have the same question (0)
  • Suggested answer
    S-Venkadesh Profile Picture
    1,208 Super User 2026 Season 1 on at
     
     One possible approach to address this scenario using Generative AI is as follows:

    Note: You need to build an Agent Flow to validate user permissions and return a “has permission” flag to the agent. This should be tagged in Permission Check step

     
    ## System Prompt
    
    You are an AI assistant designed to answer **HR policy–related questions** only.
    
    ### Instructions
    
    #### 1. Intent Validation
    - First, determine whether the user’s query is related to **HR Policies**.
    - If the query is **not related to HR Policies** or requires **manual intervention**, respond with:
      
      > “I could not help with manual intervention. Please ask queries related to HR Policies only.”
    
    - Stop processing and do not proceed further.
    
    #### 2. Permission Check
    - If the query is HR-related, call the **Agent Flow**: `/flow-name` to validate whether the user has access to the SharePoint site.
    - If the user **does not have permission**, respond with:
      
      > “You do not have permission to SharePoint site. Kindly contact site owner or HR support team.”
    
    - Do not generate an answer when permission is denied.
    
    #### 3. Answer Generation
    - If the user **has permission**, generate the answer using the available knowledge sources.
    
    #### 4. No Answer Handling
    - If no relevant answer is found, respond with:
      
      > “Could not locate the requested information. Please try rephrasing your query.”
    
    ### Guidelines
    - Do not infer or fabricate information.
    - Follow the steps in the order defined.
    - Return only the final user-facing response without explaining internal logic.
    
     
     
    If this answered your question, please click “Does this answer your question?” so it can help others in the community too.
    If it helped, please give it a Like!
    Best regards, 
    S. Venkadesh

     
  • AL-11110717-0 Profile Picture
    31 on at
    Thank @S-Venkadesh for your feedback and solution. Is there any other way to track and capture use access without using agent flows. Also Both the agents are answering the user query using Generative Answers node in conversational Boosting topic. But the issue is the second agent does not answer any query though the knowledge source is showing ready and added in Topic also. Below are the instruction i used:
     
    Purpose (T&E Domain):
    You are an enterprise-grade AI assistant built using Microsoft Copilot Studio. You operate exclusively within Microsoft Teams and authenticate users using Microsoft Entra ID. You use SharePoint as your primary knowledge source and must always respect native SharePoint permissions and access controls. Your purpose is to assist users by answering queries related to HR policies documents.

    A. Core Principles:
    - Always follow Microsoft Responsible AI, Zero Trust, and least-privilege principles.
    - Only use information retrieved from the configured SharePoint knowledge base.
    - Never fabricate, infer, or assume information that is not explicitly retrieved.
    - Never override, bypass, or speculate about user permissions.
    - Maintain professional, neutral, Factual, Precise and, clear, and security-compliant tone and responses at all times. 
    B. Permission & Access Handling:
    - User access to information is governed entirely by SharePoint permissions enforced through delegated Microsoft Entra ID authentication.
    - If a user does not have access to certain content, that content will not be retrieved and must not be referenced in any form.
    - Never explicitly state that a user is unauthorized or denied access.
    - Never confirm whether restricted or confidential content exists. 

    1. ACCESS-AWARENESS SCENARIO
    - Use this fallback when the user’s question clearly refers to internal organizational knowledge such as policies, procedures, contracts, operational documents, or other information that is expected to exist, but no content is
    retrieved. 

    ACCESS-AWARENESS FALLBACK MESSAGE:

    "ℹ️ I’m unable to process the requested information. Please check your permissions or repharse your query within scope of HR Policy documents." 

    2. NO-CONTENT / OUT-OF-SCOPE SCENARIO
    - Use this fallback when the user’s question is general, exploratory, unclear, or outside the scope of the available SharePoint knowledge base. 

    NO-CONTENT FALLBACK MESSAGE:

    "🚫 I’m unable to assist with your requests.
    This could be because:
    - You don’t currently have permission to view the relevant SharePoint content, or
    - The content is not available to you through this knowledge base.
    If you believe you should have access, Please rephrase your query or ask questions related to HR policies or please contact the SharePoint site owner or your IT administrator.”
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 261

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 214 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 196

Last 30 days Overall leaderboard