title: Amazon Lex accepting ConfirmIntent on any response
body: <p>I have an <code>intent-A</code> which is triggered by some user input. When the response is given to user I have used <code>ConfirmIntent</code> instead of <code>Close</code> so that I can switch/chain another intent (lets say <code>intent-B</code>).  </p>
  
  <p>Ideally if user type <code>"yes"</code> then intent should be triggered and if user type <code>"no"</code> then it should not. Problem is that <code>intent-B</code> is being triggered no matter what I type.</p>
  
  <p>I have read about <code>ConfirmIntent</code> from <a href="http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html" rel="nofollow noreferrer">here</a>, <a href="http://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html" rel="nofollow noreferrer">here</a> and <a href="http://docs.aws.amazon.com/lex/latest/dg/book-trip-detail-flow.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>Calling Code:</strong> </p>
  
  <pre><code>session_attributes = {"confirmationContext": "AutoPopulate"}
  return confirm_intent(session_attributes , 'intent-B', slots, 'Do you want to invoke intent-B')
  </code></pre>
  
  <p><strong>ConfirmIntent Code:</strong></p>
  
  <pre><code>def confirm_intent(session_attributes, intent_name, slots, message):
      return {
          'sessionAttributes': session_attributes,
          'dialogAction': {
              'type': 'ConfirmIntent',
              'intentName': intent_name,
              'slots': slots,
              'message': {
                  'contentType': 'PlainText',
                  'content': message
              }
          }
      }
  </code></pre>
  
  <p>In the logs I can see that <code>confirmationStatus': 'Denied'</code> when I type <code>"no</code>" but even then <code>intent-B</code> is being called.</p>
  
  <p>Am I missing something or is it designed this way?</p>
  
  <p><strong>NOTE:</strong> For workaround I am adding below code in the DialogCodeHook of <code>intent-B</code></p>
  
  <pre><code>if 'confirmationStatus' in intent_request['currentIntent'] and intent_request['currentIntent']['confirmationStatus'] == 'Denied':
      return close("Ok, let me know if you need anything else.", session_attributes)
  </code></pre>